X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;f=dsa-nagios-checks%2Fchecks%2Fdsa-check-hpssacli;h=8ae712101b79afac7034cdd70d80a9083d82fa25;hb=d12a96228342f968b0bbd470d5cbdb71cc94081c;hp=d10874b705df18af9daed84f3863e586898f53b4;hpb=10245f35c145c9620420b92497ce8f25725925cf;p=mirror%2Fdsa-nagios.git diff --git a/dsa-nagios-checks/checks/dsa-check-hpssacli b/dsa-nagios-checks/checks/dsa-check-hpssacli index d10874b..8ae7121 100755 --- a/dsa-nagios-checks/checks/dsa-check-hpssacli +++ b/dsa-nagios-checks/checks/dsa-check-hpssacli @@ -111,6 +111,7 @@ for my $slot (sort @controllers) { my @drives; my $nodrives = 0; my %status; + my @freetext; my $ldallshow = runcmd("controller slot=$slot ld all show"); my @logicaldrives; @@ -300,12 +301,12 @@ for my $slot (sort @controllers) { next; }; - my $cst = runcmd("controller slot=$slot show status"); + my $cst = runcmd("controller slot=$slot show detail"); for (@$cst) { chomp; next if /^$/; next if (/^\S.*in Slot $slot/); - if (/^ *(.*) Status: (.*)$/) { + if (/^ *(Controller|Cache|Battery\/Capacitor) Status: (.*)$/) { my $system = $1; my $status = $2; @@ -318,17 +319,23 @@ for my $slot (sort @controllers) { next if $status =~ /^(OK|Not Configured)$/; } - push @{$status{$status}}, $system; + push @freetext, "$system: $status"; if ($status ne 'OK') { next if ($params->{'no-battery'} && $system eq 'Battery/Capacitor'); record('WARNING'); }; - } else { - die ("Cannot read line '$_' gotten from hpssacli controller slot=$slot show status\n"); + } elsif (/^ *(Cache Status Details): (Cable Error)/) { + push @freetext, $2; + record('CRITICAL'); + } elsif (/^ *(Battery\/Capacitor Count): (.*)/) { + next if $params->{'no-battery'} || int($2) > 0; + push @freetext, "Battery count: $2"; + record('CRITICAL'); }; }; - my $status = join(" - ", (map { $_.": ".join(", ", @{$status{$_}}) } keys %status)); + my $status = join(" - ", ((map { $_.": ".join(", ", @{$status{$_}}) } keys %status), @freetext)); + push @resultstr, "Slot $slot: $status"; };