};
}
-my $usage = "$PROGRAM_NAME: Usage: $PROGRAM_NAME [--no-battery] [--ignore-controller=<regex>] [--no-controller-ok] [--ignore-transfer-speed=<pd> [--ignore-transfer-speed=<pd> ...]]\n";
+my $usage = "$PROGRAM_NAME: Usage: $PROGRAM_NAME [--no-battery] [--ignore-cache] [--ignore-controller=<regex>] [--no-controller-ok] [--ignore-transfer-speed=<pd> [--ignore-transfer-speed=<pd> ...]]\n";
my $params;
Getopt::Long::Configure('bundling');
if (!GetOptions (
'--help' => \$params->{'help'},
'--no-battery' => \$params->{'no-battery'},
'--no-controller-ok' => \$params->{'no-controller-ok'},
+ '--ignore-cache' => \$params->{'ignore-cache'},
'--ignore-controller=s' => \$params->{'ignore-controller'},
'--ignore-transfer-speed=s@' => \$params->{'ignore-transfer-speed'},
)) {
next if (/^\S.*in Slot $slot/);
next if /^ *array [A-Z]$/;
next if /^ *unassigned/;
+ if (/^ *HBA Drives/) {
+ # HBA mode implies no logical drives, thus reset the "drives found" check and proceed with
+ # checking physical drives.
+ $nodrives = 0;
+ next;
+ }
if (/^ *(array [A-Z]) \(Failed\)$/) {
record('CRITICAL');
push @{$status{'Failed'}}, $1;
# - 'Permanently Disabled'
# - ...?
next if $status =~ /^(OK|Not Configured)$/;
+ if ($params->{'ignore-cache'}) {
+ push @freetext, "$system: $status (ignored)";
+ next;
+ }
}
push @freetext, "$system: $status";