Blowers bug fix

Follows a fan failure on one of our BladeCenter in our hospital. I corrected the bug that indicates OK status despite one of the failed fans on both. Since this is a major issue on a BladeCenter, I removed the warning state to go directly to critical.

For that I control the state returned for the fan “blower1state and blower2state and I add in addition a condition for which the fan must have a speed of rotation different from 0%:
and blower1speed != “0% of maximum”:

def check_blowers():
” Check blower status ”
blowers = getTable(“1.3.6.1.4.1.2.3.51.2.2.3”)
# This mib only seems to support 2 blowers.
blower1speed = snmpget(“1.3.6.1.4.1.2.3.51.2.2.3.1.0”)
blower1state = snmpget(“1.3.6.1.4.1.2.3.51.2.2.3.10.0”)

blower2speed = snmpget(“1.3.6.1.4.1.2.3.51.2.2.3.2.0”)
blower2state = snmpget(“1.3.6.1.4.1.2.3.51.2.2.3.11.0”)

add_long( “Blower 1 state=%s speed=%s” % (blower1state,blower1speed) )
add_long( “Blower 2 state=%s speed=%s” % (blower2state,blower2speed) )
add_perfdata(“blower1=%s” %(blower1speed.split(None,1)[0] ))
add_perfdata(“blower2=%s” %(blower2speed.split(None,1)[0] ))
# Check blower 1
if blower1state == “1” and blower1speed != “0% of maximum”:
nagios_status(ok)
add_summary(“Ventilateur 1 OK. ” )
else:
add_summary(“Ventilateur 1 KO. “)
nagios_status(critical)

# Check blower 2
if blower2state == “1” and blower2speed != “0% of maximum”:
nagios_status(ok)
add_summary(“Ventilateur 2 OK. ” )
else:
add_summary(“Ventilateur 2 KO. “)
nagios_status(critical)