From bf0edd899b9e25b6a50ac40e11e0c2a42a2b00c8 Mon Sep 17 00:00:00 2001 From: Tomas Edwardsson Date: Thu, 28 Aug 2014 11:33:30 +0000 Subject: [PATCH] Regex filtering broke disk checks --- check_disks.pl/check_disks.pl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/check_disks.pl/check_disks.pl b/check_disks.pl/check_disks.pl index 2c1494a..a86805a 100755 --- a/check_disks.pl/check_disks.pl +++ b/check_disks.pl/check_disks.pl @@ -251,10 +251,10 @@ if ($ret > 1) { # foreach my $l (@output) { + next if ($l =~ m/$opt_R/); + next if ($l !~ m/$opt_r/); + next if ($l =~ m/$exclude_re/); if($l =~ /(\d+)\s+(\d+)\s+(\d+)\s+(\d+)\%\s+([\/\w\d\.-]+)$/) { - next if ($l =~ m/$opt_R/); - next if ($l !~ m/$opt_r/); - next if ($l =~ m/$exclude_re/); my ($s,$u,$f,$pu,$d) = ($1,$2,$3,$4,$5); $alldisks{$d}->{pused} = $pu; $alldisks{$d}->{pfree} = 100-$pu; @@ -268,10 +268,10 @@ foreach my $l (@output) { # This is the output of df.exe on Windows #C:\ 9097126 6094081 3003045 67% argon-c (ntfs) else { - if ($l =~ /(\w)\:\\\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)\%\s+(.*)$/) { next if ($l =~ m/$opt_R/); next if ($l !~ m/$opt_r/); next if ($l =~ m/$exclude_re/); + if ($l =~ /(\w)\:\\\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)\%\s+(.*)$/) { my ($d,$s,$u,$f,$pu) = ("/$1",$2,$3,$4,$5); $alldisks{$d}->{pused} = $pu; $alldisks{$d}->{pfree} = 100-$pu;