projects
/
mirror
/
dsa-nagios.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[project @ peter@palfrader.org-20090227104631-2gn32u1sr3lpksml]
[mirror/dsa-nagios.git]
/
dsa-nagios-nrpe-config
/
dsa-check-hpacucli
diff --git
a/dsa-nagios-nrpe-config/dsa-check-hpacucli
b/dsa-nagios-nrpe-config/dsa-check-hpacucli
index
2fc7018
..
a347388
100755
(executable)
--- 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 /^$/;
for (@$pds) {
chomp;
next if /^$/;
- next if /^ *array [A-Z]$/;
next if (/^\S.*in Slot $slot/);
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;
$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) {
# 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';
my $type;
if ($drive =~ /^[0-9]+:[0-9]+$/) { # scsi drives
$type = 'SCSI';
@@
-158,7
+163,11
@@
for my $slot (sort @controllers) {
};
} elsif ($type eq 'SAS') {
$key = 'PHY Transfer Rate';
};
} elsif ($type eq 'SAS') {
$key = 'PHY Transfer Rate';
- $expected = '3.0GBPS';
+ if ($value{'PHY Count'} eq '2') {
+ $expected = '3.0GBPS, Unknown';
+ } else {
+ $expected = '3.0GBPS';
+ }
} else {
warn "Should not be here. Do not know what to do with type '$type'\n";
next;
} else {
warn "Should not be here. Do not know what to do with type '$type'\n";
next;