From 4226c5a9c546019111121c43ab799009cf789f52 Mon Sep 17 00:00:00 2001 From: Filippo Giunchedi Date: Tue, 6 Feb 2018 22:27:49 +0100 Subject: [PATCH] dsa-check-hpssacli: check PDs only when in HBA mode 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. --- dsa-nagios-checks/checks/dsa-check-hpssacli | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/dsa-nagios-checks/checks/dsa-check-hpssacli b/dsa-nagios-checks/checks/dsa-check-hpssacli index 8ae7121..3dfd488 100755 --- a/dsa-nagios-checks/checks/dsa-check-hpssacli +++ b/dsa-nagios-checks/checks/dsa-check-hpssacli @@ -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; -- 2.20.1