Skip to content
Snippets Groups Projects
Commit bef265d2 authored by Sergey Ivanov's avatar Sergey Ivanov
Browse files

more fixes

parent e4373a5f
No related branches found
No related tags found
No related merge requests found
......@@ -86,26 +86,6 @@ sub handler {
my $oldhowlong = ( ( -r $statusfile ) ? `cat $statusfile` : 0 );
chomp $oldhowlong;
$oldhowlong = 0 unless $oldhowlong =~ /^[\d]+$/;
=pod
scan: scrub repaired 0 in 78h6m with 0 errors on Tue Mar 29 00:16:48 2016
- or -
scan: scrub repaired 0B in 0 days 09:55:51 with 0 errors on Thu Mar 7 01:46:05 2019
- or -
scan: scrub repaired 0B in 14:02:48 with 0 errors on Fri Oct 1 16:02:50 2021
- or -
scan: scrub in progress since Tue Mar 29 19:09:47 2016
14.3G scanned out of 47.0G at 172M/s, 0h3m to go
0 repaired, 30.42% done
- or -
scan: resilver in progress since Fri Aug 7 14:07:30 2020
451G scanned at 2.17G/s, 2.13M issued at 10.5K/s, 19.6T total
0B resilvered, 0.00% done, no estimated completion time
- or -
scan: resilver in progress since Fri Aug 7 14:07:30 2020
855G scanned at 188M/s, 227G issued at 49.9M/s, 19.6T total
228G resilvered, 1.13% done, 4 days 17:00:28 to go
=cut
my ($when,$days,$h,$m,$s,$howlong,$togo,$repaired,$errors,$canceled)
=(0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0);
my $STATUSCMD = "/usr/sbin/zpool status $zpool";
......@@ -122,6 +102,9 @@ sub handler {
$errors = 0;
$canceled = 1;
}
=pod
scan: scrub repaired 0B in 0 days 09:55:51 with 0 errors on Thu Mar 7 01:46:05 2019
=cut
elsif (/^\s*scan:\s+scrub\s+repaired\s+(\d*B*)\D*\s+in\s+(\d*)\s+days\s+(\d*):(\d*):(\d*)\s+with\s+(\d*)\s+errors\s+on\s+(.+)$/){
($repaired,$days,$h,$m,$s,$errors,$when) = ($1,$2,$3,$4,$5,$6,$7);
$when = `$DATE '+%s'` - `$DATE '+%s' -d "$when"`;
......@@ -129,6 +112,11 @@ sub handler {
$when += 60*$howlong;
$repaired += $errors if $repaired < $errors;
}
=pod
scan: scrub repaired 0 in 78h6m with 0 errors on Tue Mar 29 00:16:48 2016
- or -
scan: scrub repaired 0B in 14:02:48 with 0 errors on Fri Oct 1 16:02:50 2021
=cut
elsif (/^\s*scan:\s+scrub\s+repaired\s+(\d*B*)\s+in\s+(\d*)[h\:](\d*)[m\:](\d*)\s+with\s+(\d*)\s+errors\s+on\s+(.+)$/){
($repaired,$h,$m,$s,$errors,$when) = ($1,$2,$3,$4,$5,$6);
$when = `$DATE '+%s'` - `$DATE '+%s' -d "$when"`;
......@@ -148,18 +136,38 @@ sub handler {
$when /= 60;
$when = int($when);
}
elsif ( (/^\s*\S+B*\s+scanned.*,\s+(\d+)h(\d+)m\s+to\s+go\s*$/) or
(/^\s*\S+B*\s+resilvered.*,\s+(\d+)h(\d+)m\s+to\s+go\s*$/)
=pod
14.3G scanned out of 47.0G at 172M/s, 0h3m to go
0 repaired, 30.42% done
- or -
855G scanned at 188M/s, 227G issued at 49.9M/s, 19.6T total
228G resilvered, 1.13% done, 4 days 17:00:28 to go
- or -
6.64T scanned at 45.7M/s, 5.62T issued at 38.7M/s, 11.4T total
0B repaired, 49.49% done, 1 days 19:09:46 to go
=cut
elsif ( (/^\s*\S+\s+scanned.*,\s+(\d+)h(\d+)m\s+to\s+go\s*$/) or
(/^\s*\S+\s+resilvered.*,\s+(\d+)h(\d+)m\s+to\s+go\s*$/) or
(/^\s*\S+\s+repaired.*,\s+(\d+)h(\d+)m\s+to\s+go\s*$/)
){
$togo = $1*60 +$2;
$howlong = $oldhowlong;
}
elsif ( (/^\s*\S+B*\s+scanned.*,\s+(\d+)\s+days\s+(\d+):(\d+):(\d+)\s+to\s+go\s*$/) or
(/^\s*\S+B*\s+resilvered.*,\s+(\d+)\s+days\s+(\d+):(\d+):(\d+)\s+to\s+go\s*$/)
elsif ( (/^\s*\S+\s+scanned.*,\s+(\d+)\s+days\s+(\d+):(\d+):(\d+)\s+to\s+go\s*$/) or
(/^\s*\S+\s+resilvered.*,\s+(\d+)\s+days\s+(\d+):(\d+):(\d+)\s+to\s+go\s*$/) or
(/^\s*\S+\s+repaired.*,\s+(\d+)\s+days\s+(\d+):(\d+):(\d+)\s+to\s+go\s*$/)
){
$togo = ($1*24 + $2)*60 +$3;
$howlong = $oldhowlong;
}
=pod
- or -
scan: resilver in progress since Fri Aug 7 14:07:30 2020
451G scanned at 2.17G/s, 2.13M issued at 10.5K/s, 19.6T total
0B resilvered, 0.00% done, no estimated completion time
=cut
elsif ( (/^\s*(\d+B*)\s+repaired,/) or
(/^\s*(\d+B*)\s+resilvered,/)
){
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment