dsa-check-hpssacli: ignore text after "active spare" from pd status
authorJulien Cristau <jcristau@debian.org>
Sat, 15 Dec 2018 10:00:06 +0000 (11:00 +0100)
committerJulien Cristau <jcristau@debian.org>
Sat, 15 Dec 2018 10:00:06 +0000 (11:00 +0100)
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

index 6cae39d..2982600 100755 (executable)
@@ -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;