glensc / nagios-plugin-check_raid

Nagios/Icinga/Sensu plugin to check current server's RAID status ⛺
143 stars 84 forks source link

sas2ircu detects hot spares as critical #159

Open tiger-jmw opened 7 years ago

tiger-jmw commented 7 years ago

Hi,

The sas2ircu plugin claims hot spares are an error:

DEBUG EXEC: /sbin/dmsetup status --noflush at /usr/local/lib/nagios/plugins/check_raid line 487.
DEBUG EXEC: /usr/sbin/sas2ircu LIST at /usr/local/lib/nagios/plugins/check_raid line 487.
DEBUG EXEC: /usr/sbin/sas2ircu 0 STATUS at /usr/local/lib/nagios/plugins/check_raid line 487.
DEBUG EXEC: /usr/sbin/sas2ircu 0 DISPLAY at /usr/local/lib/nagios/plugins/check_raid line 487.
CRITICAL: dm:[No devices to check]; sas2ircu:[ctrl #0: 1 Vols: Optimal: 4 Drives: Hot Spare (HSP): ERROR:Ctrl0:Enc1:Slot2:Hot Spare (HSP) ERROR:Ctrl0:Enc1:Slot3:Hot Spare (HSP):]

Actually this array is fine and just has two hot spares so the status should be 'OK'.

The following patch treats the status 'Hot Spare' as equivalent to 'Optimal' and 'Ready':

diff --git a/lib/App/Monitoring/Plugin/CheckRaid/Plugins/sas2ircu.pm b/lib/App/Monitoring/Plugin/CheckRaid/Plugins/sas2ircu.pm
index e551fa8..0ce63f2 100644
--- a/lib/App/Monitoring/Plugin/CheckRaid/Plugins/sas2ircu.pm
+++ b/lib/App/Monitoring/Plugin/CheckRaid/Plugins/sas2ircu.pm
@@ -217,7 +217,7 @@ sub check {
                                                #if ($numslots == 10 ) { $state='FREDFISH';}

                                                #when we get a state, test on it and report it..
-                                               if ($state =~ /Optimal|Ready/) {
+                                               if ($state =~ /Optimal|Ready|Hot Spare/) {
                                                        #do nothing at the moment.
                                                } else {
                                                        $this->critical;
tiger-jmw commented 7 years ago

https://github.com/glensc/nagios-plugin-check_raid/pull/160

glensc commented 7 years ago

Neither of the tickets provide required output of commands ran from your system. See CONTRIBUTING.md