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

Fix crash where bladecenter has undocumented extra info, but only partial (closes #62 and #54)

This commit is contained in:
Pall Sigurdsson 2012-07-17 19:59:51 +00:00
parent afb015b67d
commit 59dc82fd44

View File

@ -271,10 +271,12 @@ def check_switchmodules():
add_long("Module%s health bad(%s).\n post=%s" % (myIndex, healthstate,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):
try:
myExtraInfo = extrainfo[int(myIndex)-1] myExtraInfo = extrainfo[int(myIndex)-1]
module_type = myExtraInfo[22] module_type = myExtraInfo[22]
module_ip = myExtraInfo[6] module_ip = myExtraInfo[6]
add_long( " type=%s ip=%s" % (module_type,module_ip) ) add_long( " type=%s ip=%s" % (module_type,module_ip) )
except: pass
if exit_status == ok: if exit_status == ok:
add_summary("All switchmodules healthy") add_summary("All switchmodules healthy")