From d10960e7016e69c430c976178d011850edad0f38 Mon Sep 17 00:00:00 2001 From: Sergey Ivanov <seriv@omnia.spectr.org> Date: Fri, 1 Oct 2021 16:38:23 -0400 Subject: [PATCH] to work with zfs/2.1.1 --- lib/Site/ZpoolScrub.pm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/Site/ZpoolScrub.pm b/lib/Site/ZpoolScrub.pm index e7e56b8..47e18b1 100644 --- a/lib/Site/ZpoolScrub.pm +++ b/lib/Site/ZpoolScrub.pm @@ -90,6 +90,8 @@ sub handler { 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 @@ -127,8 +129,8 @@ sub handler { $when += 60*$howlong; $repaired += $errors if $repaired < $errors; } - elsif (/^\s*scan:\s+scrub\s+repaired\s+(\d*)\s+in\s+(\d*)h(\d*)m\s+with\s+(\d*)\s+errors\s+on\s+(.+)$/){ - ($repaired,$h,$m,$errors,$when) = ($1,$2,$3,$4,$5); + 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"`; $howlong = 60*$h+$m; $when += 60*$howlong; -- GitLab