nagios-plugin-check_raid icon indicating copy to clipboard operation
nagios-plugin-check_raid copied to clipboard

sas2ircu detects hot spares as critical

Open tiger-jmw opened this issue 7 years ago • 2 comments

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 avatar Dec 14 '16 16:12 tiger-jmw

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

tiger-jmw avatar Dec 14 '16 16:12 tiger-jmw

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

glensc avatar Dec 14 '16 17:12 glensc