+ $slot = $1;
+ $controllers{$slot} = ();
+ } elsif (/^ *(Controller|Cache|Battery\/Capacitor) Status: (.*)$/) {
+ my $system = $1;
+ my $status = $2;
+
+ if ($system eq 'Cache') {
+ # Can be:
+ # - 'OK'
+ # - 'Not Configured' (for e.g. HP SSD Smart Path)
+ # - 'Permanently Disabled'
+ # - ...?
+ next if $status =~ /^(OK|Not Configured)$/;
+ if ($params->{'ignore-cache'}) {
+ push @{$controllers{$slot}}, "$system: $status (ignored)";
+ next;
+ }
+ }
+
+ push @{$controllers{$slot}}, "$system: $status";
+ if ($status ne 'OK') {
+ next if ($params->{'no-battery'} && $system eq 'Battery/Capacitor');
+ record('WARNING');
+ };
+ } elsif (/^ *(Cache Status Details): (Cable Error)/) {
+ push @{$controllers{$slot}}, $2;
+ record('CRITICAL');
+ } elsif (/^ *(Battery\/Capacitor Count): (.*)/) {
+ next if $params->{'no-battery'} || int($2) > 0;
+ push @{$controllers{$slot}}, "Battery count: $2";
+ record('CRITICAL');