From 59dc82fd447d42524b8d2763f8a4dd2c64307cac Mon Sep 17 00:00:00 2001 From: Pall Sigurdsson Date: Tue, 17 Jul 2012 19:59:51 +0000 Subject: [PATCH] Fix crash where bladecenter has undocumented extra info, but only partial (closes #62 and #54) --- check_ibm_bladecenter/check_ibm_bladecenter.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/check_ibm_bladecenter/check_ibm_bladecenter.py b/check_ibm_bladecenter/check_ibm_bladecenter.py index b8dc72e..b143bd9 100644 --- a/check_ibm_bladecenter/check_ibm_bladecenter.py +++ b/check_ibm_bladecenter/check_ibm_bladecenter.py @@ -271,10 +271,12 @@ def check_switchmodules(): add_long("Module%s health bad(%s).\n post=%s" % (myIndex, healthstate,resultvalue) ) add_summary("Problem with Module %s. " % (myIndex)) if len(extrainfo) > int(myIndex): - myExtraInfo = extrainfo[int(myIndex)-1] - module_type = myExtraInfo[22] - module_ip = myExtraInfo[6] - add_long( " type=%s ip=%s" % (module_type,module_ip) ) + try: + myExtraInfo = extrainfo[int(myIndex)-1] + module_type = myExtraInfo[22] + module_ip = myExtraInfo[6] + add_long( " type=%s ip=%s" % (module_type,module_ip) ) + except: pass if exit_status == ok: add_summary("All switchmodules healthy")