X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;f=dsa-nagios-nrpe-config%2Fdsa-check-hpacucli;h=ce0910e8760882c12c42e516198827195544ceeb;hb=74fcb5cf4cefb61dc95b384d616c66c9175bc8ab;hp=2fc701810f37402e0abb9292c0b986ac96ac3277;hpb=bafe766e556a9839f0f5bb6cce8f4c9fc1c9f47c;p=mirror%2Fdsa-nagios.git diff --git a/dsa-nagios-nrpe-config/dsa-check-hpacucli b/dsa-nagios-nrpe-config/dsa-check-hpacucli index 2fc7018..ce0910e 100755 --- a/dsa-nagios-nrpe-config/dsa-check-hpacucli +++ b/dsa-nagios-nrpe-config/dsa-check-hpacucli @@ -90,9 +90,12 @@ for my $slot (sort @controllers) { for (@$pds) { chomp; next if /^$/; - next if /^ *array [A-Z]$/; next if (/^\S.*in Slot $slot/); - if (/^Error: The specified controller does not have any physical drives on it.$/) { + next if /^ *array [A-Z]$/; + if (/^ *(array [A-Z]) \(Failed\)$/) { + record('CRITICAL'); + 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)(?:, spare)?\)$/) { my $drive = $1; @@ -116,6 +119,8 @@ for my $slot (sort @controllers) { # Check that all drives have the proper transfer speed. # sometimes stuff breaks and they fall back to 10mb/sec. for my $drive (@drives) { + # skip drives that are known to have failed + next if (exists $status{'Failed'} && grep {$drive eq $_} @{$status{'Failed'}}); my $type; if ($drive =~ /^[0-9]+:[0-9]+$/) { # scsi drives $type = 'SCSI';