From: Filippo Giunchedi Date: Tue, 6 Feb 2018 21:27:49 +0000 (+0100) Subject: dsa-check-hpssacli: check PDs only when in HBA mode X-Git-Url: https://git.adam-barratt.org.uk/?p=mirror%2Fdsa-nagios.git;a=commitdiff_plain;h=4226c5a9c546019111121c43ab799009cf789f52 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. --- 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;