dsa-check-hpssacli: check PDs only when in HBA mode
[mirror/dsa-nagios.git] / dsa-nagios-checks / checks / dsa-check-hpssacli
index 8ae7121..3dfd488 100755 (executable)
@@ -180,6 +180,12 @@ for my $slot (sort @controllers) {
                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;