hpssacli: don't barf on HP SSD Smart Path configs
authorFaidon Liambotis <paravoid@debian.org>
Thu, 2 Jun 2016 12:24:05 +0000 (15:24 +0300)
committerJulien Cristau <jcristau@debian.org>
Thu, 2 Jun 2016 17:05:59 +0000 (19:05 +0200)
On systems with SSD arrays, one of the recommended HP configurations
-and as far as I know, the default- is to disable the BBU cache and use
a technology that's instead called "HP SSD Smart Path".

In these cases, dsa-check-hpssacli warns, as "controller slot=N show
status" returns "Cache: Not Configured", despite this being a valid
configuration.

It turns out that there is another field, per LD, called "LD
Acceleration Method" that can get the values of "Controller Cache", "HP
SSD Smart Path" or "All disabled"; the first two being OK, the latter
one indicative of a problem. Switch the check to use those instead.

I've yet to see a controller with a failed or misconfigured cache, so
I'm not entirely sure that a config with "LD Acceleration Method:
Controller Cache" and "Cache: Not Configured" would not occur. That
wouldn't make any sense though, so let's risk it :)

Signed-off-by: Julien Cristau <jcristau@debian.org>
dsa-nagios-checks/checks/dsa-check-hpssacli

index 4f97a52..959198e 100755 (executable)
@@ -149,6 +149,14 @@ for my $slot (sort @controllers) {
                                        record('UNKNOWN');
                                }
                        }
+                       if (/^ *LD Acceleration Method: (.*)$/) {
+                               my $status = $1;
+                               # can at least be "Controller Cache" or HP SSD Smart Path", both OK
+                               if ($status eq 'All disabled') {
+                                       push @{$status{'Acceleration method'}}, "LD$logicaldrive disabled";
+                                       record('WARNING');
+                               }
+                       }
                }
        }
 
@@ -300,9 +308,12 @@ for my $slot (sort @controllers) {
                if (/^ *(.*) Status: (.*)$/) {
                        my $system = $1;
                        my $status = $2;
+
+                       # skip the cache check, we track the LD Acceleration Method above
+                       next if ($system eq 'Cache');
+
                        push @{$status{$status}}, $system;
                        if ($status ne 'OK') {
-                               next if ($params->{'no-battery'} && $system eq 'Cache');
                                next if ($params->{'no-battery'} && $system eq 'Battery/Capacitor');
                                record('WARNING');
                        };