raid/hpssacli: WARN on permanently disabled cache
authorFaidon Liambotis <paravoid@debian.org>
Mon, 29 May 2017 17:17:25 +0000 (20:17 +0300)
committerPaul Wise <pabs@debian.org>
Tue, 30 May 2017 03:10:18 +0000 (11:10 +0800)
Commit 2f4db17df6b239dbe91da46779fd0c723bfdc14d skipped the Cache Status
line of "controller slot=N show status", in an effort to make it not
warn on HP SSD Smart Path configurations where Cache Status was set to
"Not Configured". We were checking instead the LD Acceleration Status
for each logical drive, which was indicative in the past.

We have now seen a case out in the wild where Cache Status is set to
"Permanently Disabled", indicative of an issue with the hardware's
battery, but LDs all report "LD Acceleration Status: Controller Cache"
and "Caching:  Enabled".

Change the Cache Status check to explicitly check for "OK" or "Not
Configured" and otherwise emit a WARNING.

Signed-off-by: Faidon Liambotis <paravoid@debian.org>
dsa-nagios-checks/checks/dsa-check-hpssacli

index 959198e..d10874b 100755 (executable)
@@ -309,8 +309,14 @@ for my $slot (sort @controllers) {
                        my $system = $1;
                        my $status = $2;
 
-                       # skip the cache check, we track the LD Acceleration Method above
-                       next if ($system eq 'Cache');
+                       if ($system eq 'Cache') {
+                               # Can be:
+                               # - 'OK'
+                               # - 'Not Configured' (for e.g. HP SSD Smart Path)
+                               # - 'Permanently Disabled'
+                               # - ...?
+                               next if $status =~ /^(OK|Not Configured)$/;
+                       }
 
                        push @{$status{$status}}, $system;
                        if ($status ne 'OK') {