when using dsa-check-hpssacli with controllers in HBA mode the check
misbehaves on the "HBA Drives" line itself. The patch below fixes things
to check only PDs in the HBA case.
We've discovered this at Wikimedia Foundation where the check is also
deployed, see https://phabricator.wikimedia.org/T185216 for more
context.
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;