[project @ peter@palfrader.org-20080521002311-3w8q0zp2dpa6p0ph]
[mirror/dsa-nagios.git] / dsa-nagios-nrpe-config / dsa-check-hpacucli
index 26a07fe..1fd74e6 100755 (executable)
@@ -93,12 +93,13 @@ for my $slot (sort @controllers) {
                next if (/^\S.*in Slot $slot/);
                if (/^Error: The specified controller does not have any physical drives on it.$/) {
                        $nodrives = 1;
-               } elsif (/^ *physicaldrive (\S+) .* (OK|Predictive Failure|Failed)(?:, spare)?\)$/) {
+               } elsif (/^ *physicaldrive (\S+) .* (OK|Predictive Failure|Failed|Rebuilding)(?:, spare)?\)$/) {
                        my $drive = $1;
                        my $status = $2;
                        push @{$status{$status}}, $drive;
                        if ($status eq 'OK') {
-                       } elsif ($status eq 'Predictive Failure') {
+                       } elsif ($status eq 'Predictive Failure' ||
+                                $status eq 'Rebuilding') {
                                record('WARNING');
                        } elsif ($status eq 'Failed') {
                                record('CRITICAL');
@@ -136,9 +137,9 @@ for my $slot (sort @controllers) {
                };
        };
 
-       my $status = join("; ", (map { $_.": ".join(", ", @{$status{$_}}) } keys %status));
+       my $status = join(" - ", (map { $_.": ".join(", ", @{$status{$_}}) } keys %status));
        push @resultstr, "Slot $slot: $status";
 };
 
-print "$EXITCODE: ", join(" - ", @resultstr), "\n";
+print "$EXITCODE: ", join(" --- ", @resultstr), "\n";
 exit $CODE{$EXITCODE};