From: Peter Palfrader Date: Fri, 2 Aug 2019 08:53:44 +0000 (+0200) Subject: correctly parse % in sw raid resync (e.g. "resync = 1.7%") X-Git-Url: https://wiki.adam-barratt.org.uk/gitweb/?a=commitdiff_plain;h=44f5f0f4b2c493e83fa73f19bd127bee800f013f;p=mirror%2Fdsa-nagios.git correctly parse % in sw raid resync (e.g. "resync = 1.7%") --- diff --git a/dsa-nagios-checks/checks/dsa-check-raid-sw b/dsa-nagios-checks/checks/dsa-check-raid-sw index 0297036..7707348 100755 --- a/dsa-nagios-checks/checks/dsa-check-raid-sw +++ b/dsa-nagios-checks/checks/dsa-check-raid-sw @@ -99,7 +99,7 @@ while () { } elsif ( $line =~ / resync /) { # [==>..................] resync = 10.3% (15216320/146994624) finish=2153.2min speed=1018K/sec - my ($percent) = ($line =~ m# resync = ([0-9.]+%)#); + my ($percent) = ($line =~ m# resync *= *([0-9.]+%)#); my ($finish) = ($line =~ m# finish=([0-9.]+min)#); my ($speed) = ($line =~ m# speed=([0-9.]+K/sec)#); push @resyncing, "$device ($percent done, finish in $finish at $speed)";