From 602df53379915d705090fed25ca1942daae599f3 Mon Sep 17 00:00:00 2001 From: Julien Cristau Date: Sat, 15 Dec 2018 11:00:06 +0100 Subject: [PATCH 1/1] 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". --- dsa-nagios-checks/checks/dsa-check-hpssacli | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; -- 2.20.1