1
0
mirror of https://github.com/opinkerfi/nagios-plugins.git synced 2024-11-25 03:43:46 +01:00

--exclude option added. Added workaround around false positives

This commit is contained in:
Pall Sigurdsson 2012-11-02 09:34:37 +00:00
parent 270ddb3d97
commit d74d766e99

View File

@ -446,6 +446,9 @@ def check_bladehealth():
except: myName = "" except: myName = ""
if mySeverity == "(No severity)": continue if mySeverity == "(No severity)": continue
add_long( "blade%s (%s): %s %s" % (myBladeid,myName,mySeverity, myDescription) ) add_long( "blade%s (%s): %s %s" % (myBladeid,myName,mySeverity, myDescription) )
if opts.exclude:
if myDescription.find(opts.exclude) > -1:
continue
total_blades += 1 total_blades += 1
if mySeverity == 'Good': if mySeverity == 'Good':
nagios_status(ok) nagios_status(ok)
@ -462,11 +465,17 @@ def check_systemhealth():
systemhealthstat = snmpget('1.3.6.1.4.1.2.3.51.2.2.7.1.0') systemhealthstat = snmpget('1.3.6.1.4.1.2.3.51.2.2.7.1.0')
summary = getTable('1.3.6.1.4.1.2.3.51.2.2.7.2.1') summary = getTable('1.3.6.1.4.1.2.3.51.2.2.7.2.1')
index,severity,description,date = (1,2,3,4) index,severity,description,date = (1,2,3,4)
# Sometimes chassis delivers warning when absolutely nothing is going on. Lets work around that
workaround = [{1: '1', 2: 'Good', 3: 'No critical or warning events', 4: 'No timestamp'}]
# Check overall health # Check overall health
if systemhealthstat == '255': if systemhealthstat == '255':
nagios_status(ok) nagios_status(ok)
add_summary("Bladecenter health: OK. ") add_summary("Bladecenter health: OK. ")
elif systemhealthstat == "2": elif systemhealthstat == "2":
if summary.values() == workaround:
add_summary("Non-Critical Error: %s " % workaround[0][description] )
nagios_status(ok)
return
nagios_status(warning) nagios_status(warning)
add_summary("Non-Critical Error. ") add_summary("Non-Critical Error. ")
elif systemhealthstat == "4": elif systemhealthstat == "4":
@ -483,6 +492,8 @@ def check_systemhealth():
nagios_status(ok) nagios_status(ok)
elif row[severity] == 'Warning': elif row[severity] == 'Warning':
nagios_status(warning) nagios_status(warning)
elif row[severity] == 'System Level':
nagios_status(warning)
else: else:
nagios_status(critical) nagios_status(critical)
add_summary( "%s. " % (row[description]) ) add_summary( "%s. " % (row[description]) )