From: Julien Cristau Date: Sat, 15 Dec 2018 10:00:06 +0000 (+0100) Subject: dsa-check-hpssacli: ignore text after "active spare" from pd status X-Git-Url: https://wiki.adam-barratt.org.uk/gitweb/?a=commitdiff_plain;h=602df53379915d705090fed25ca1942daae599f3;p=mirror%2Fdsa-nagios.git dsa-check-hpssacli: ignore text after "active spare" from pd status Rather than getting confused by physicaldrive 1I:1:4 (port 1I:box 1:bay 4, SAS, 146 GB, OK, active spare for 1I:1:1) treat it the same as "active spare". --- diff --git a/dsa-nagios-checks/checks/dsa-check-hpssacli b/dsa-nagios-checks/checks/dsa-check-hpssacli index 6cae39d..2982600 100755 --- a/dsa-nagios-checks/checks/dsa-check-hpssacli +++ b/dsa-nagios-checks/checks/dsa-check-hpssacli @@ -192,7 +192,7 @@ for my $slot (sort @controllers) { push @{$status{'Failed'}}, $1; } elsif (/^Error: The specified controller does not have any physical drives on it.$/) { $nodrives = 1; - } elsif (/^ *physicaldrive (\S+) .* (OK|Predictive Failure|Failed|Rebuilding)(?:, (?:active )?spare)?\)$/) { + } elsif (/^ *physicaldrive (\S+) .* (OK|Predictive Failure|Failed|Rebuilding)(?:, (?:active )?spare.*)?\)$/) { my $drive = $1; my $status = $2; push @{$status{$status}}, $drive;