From 44f5f0f4b2c493e83fa73f19bd127bee800f013f Mon Sep 17 00:00:00 2001 From: Peter Palfrader Date: Fri, 2 Aug 2019 10:53:44 +0200 Subject: [PATCH] correctly parse % in sw raid resync (e.g. "resync = 1.7%") --- dsa-nagios-checks/checks/dsa-check-raid-sw | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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)"; -- 2.20.1