mirror of
https://github.com/opinkerfi/nagios-plugins.git
synced 2024-11-22 02:13:44 +01:00
check_ibm_bladecenter.py updated. Screenshots added
This commit is contained in:
parent
2d2b20b120
commit
4c60683fd0
61
check_ibm_bladecenter/check_ibm_bladecenter.py
Executable file → Normal file
61
check_ibm_bladecenter/check_ibm_bladecenter.py
Executable file → Normal file
@ -18,15 +18,7 @@
|
|||||||
# About this script
|
# About this script
|
||||||
#
|
#
|
||||||
# This script will check the status of a remote IBM Bladecenter via SNMP.
|
# This script will check the status of a remote IBM Bladecenter via SNMP.
|
||||||
# Among other things the following are monitored:
|
|
||||||
# * General Health
|
|
||||||
# * Powermodule status
|
|
||||||
# * Temperature
|
|
||||||
# * Blade health
|
|
||||||
# * Switchmodule Health
|
|
||||||
# * Management Module health
|
|
||||||
# * Blowers
|
|
||||||
# * Chassis Sensors
|
|
||||||
|
|
||||||
|
|
||||||
# No real need to change anything below here
|
# No real need to change anything below here
|
||||||
@ -87,6 +79,8 @@ parser.add_option("-p","--snmp_password", dest="snmp_password",
|
|||||||
help="SNMP password (only with SNMP v3)", default=None)
|
help="SNMP password (only with SNMP v3)", default=None)
|
||||||
parser.add_option("-l","--snmp_security_level", dest="snmp_seclevel",
|
parser.add_option("-l","--snmp_security_level", dest="snmp_seclevel",
|
||||||
help="SNMP security level (only with SNMP v3) (noAuthNoPriv|authNoPriv|authPriv)", default=None)
|
help="SNMP security level (only with SNMP v3) (noAuthNoPriv|authNoPriv|authPriv)", default=None)
|
||||||
|
parser.add_option("-t","--snmp_timeout", dest="snmp_timeout",
|
||||||
|
help="Timeout in seconds for SNMP", default=10)
|
||||||
parser.add_option("-d","--debug", dest="debug",
|
parser.add_option("-d","--debug", dest="debug",
|
||||||
help="Enable debugging (for troubleshooting", action="store_true", default=False)
|
help="Enable debugging (for troubleshooting", action="store_true", default=False)
|
||||||
|
|
||||||
@ -115,6 +109,7 @@ def set_snmp_options():
|
|||||||
if opts.snmp_community is None:
|
if opts.snmp_community is None:
|
||||||
parser.error("--snmp_community is required with --snmp_version=1|2c")
|
parser.error("--snmp_community is required with --snmp_version=1|2c")
|
||||||
snmp_options = snmp_options + " -c %s " % opts.snmp_community
|
snmp_options = snmp_options + " -c %s " % opts.snmp_community
|
||||||
|
snmp_options += " -t %s " % (opts.snmp_timeout)
|
||||||
|
|
||||||
def error(errortext):
|
def error(errortext):
|
||||||
print "* Error: %s" % errortext
|
print "* Error: %s" % errortext
|
||||||
@ -269,7 +264,7 @@ def check_switchmodules():
|
|||||||
add_long("Module%s health good.\n post=%s" % (myIndex,resultvalue))
|
add_long("Module%s health good.\n post=%s" % (myIndex,resultvalue))
|
||||||
else:
|
else:
|
||||||
nagios_status(warning)
|
nagios_status(warning)
|
||||||
add_long("Module%s health bad.\n post=%s" % (myIndex, resultvalue) )
|
add_long("Module%s health bad(%s).\n post=%s" % (myIndex, healthstate,resultvalue) )
|
||||||
add_summary("Problem with Module %s. " % (myIndex))
|
add_summary("Problem with Module %s. " % (myIndex))
|
||||||
if len(extrainfo) > int(myIndex):
|
if len(extrainfo) > int(myIndex):
|
||||||
myExtraInfo = extrainfo[int(myIndex)-1]
|
myExtraInfo = extrainfo[int(myIndex)-1]
|
||||||
@ -441,7 +436,8 @@ def check_bladehealth():
|
|||||||
myBladeid = row[bladeid]
|
myBladeid = row[bladeid]
|
||||||
mySeverity = row[severity]
|
mySeverity = row[severity]
|
||||||
myDescription = row[description]
|
myDescription = row[description]
|
||||||
myName = bladestate[i][6]
|
try: myName = bladestate[i][6]
|
||||||
|
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) )
|
||||||
total_blades += 1
|
total_blades += 1
|
||||||
@ -470,7 +466,7 @@ def check_systemhealth():
|
|||||||
elif systemhealthstat == "4":
|
elif systemhealthstat == "4":
|
||||||
nagios_status(critical)
|
nagios_status(critical)
|
||||||
add_summary("System-Level Error. ")
|
add_summary("System-Level Error. ")
|
||||||
elif systemhealth == "0":
|
elif systemhealthstat == "0":
|
||||||
nagios_status(critical)
|
nagios_status(critical)
|
||||||
add_summary("Critical. ")
|
add_summary("Critical. ")
|
||||||
else:
|
else:
|
||||||
@ -483,7 +479,8 @@ def check_systemhealth():
|
|||||||
nagios_status(warning)
|
nagios_status(warning)
|
||||||
else:
|
else:
|
||||||
nagios_status(critical)
|
nagios_status(critical)
|
||||||
add_summary( "%s: %s" % (row[severity], row[description]) )
|
add_summary( "%s. " % (row[description]) )
|
||||||
|
add_long( "* %s. " % (row[description]) )
|
||||||
|
|
||||||
def check_temperature():
|
def check_temperature():
|
||||||
# set some sensible defaults
|
# set some sensible defaults
|
||||||
@ -507,21 +504,25 @@ def check_temperature():
|
|||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
set_snmp_options()
|
try:
|
||||||
if opts.mode == 'powermodules':
|
set_snmp_options()
|
||||||
check_powermodules()
|
if opts.mode == 'powermodules':
|
||||||
elif opts.mode == 'system-health':
|
check_powermodules()
|
||||||
check_systemhealth()
|
elif opts.mode == 'system-health':
|
||||||
elif opts.mode == 'temperature':
|
check_systemhealth()
|
||||||
check_temperature()
|
elif opts.mode == 'temperature':
|
||||||
elif opts.mode == 'chassis-status':
|
check_temperature()
|
||||||
check_chassis_status()
|
elif opts.mode == 'chassis-status':
|
||||||
elif opts.mode == 'bladehealth':
|
check_chassis_status()
|
||||||
check_bladehealth()
|
elif opts.mode == 'bladehealth':
|
||||||
elif opts.mode == 'blowers':
|
check_bladehealth()
|
||||||
check_blowers()
|
elif opts.mode == 'blowers':
|
||||||
elif opts.mode == 'switchmodules':
|
check_blowers()
|
||||||
check_switchmodules()
|
elif opts.mode == 'switchmodules':
|
||||||
else:
|
check_switchmodules()
|
||||||
parser.error("%s is not a valid option for --mode" % opts.mode)
|
else:
|
||||||
|
parser.error("%s is not a valid option for --mode" % opts.mode)
|
||||||
|
except Exception, e:
|
||||||
|
print "Unhandled exception while running script: %s" % e
|
||||||
|
exit(unknown)
|
||||||
end()
|
end()
|
||||||
|
BIN
check_ibm_bladecenter/check_ibm_bladecenter_screenshot.png
Normal file
BIN
check_ibm_bladecenter/check_ibm_bladecenter_screenshot.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 60 KiB |
Loading…
Reference in New Issue
Block a user