From b05e02a6c40131c4016e68f9f90521ddb474ce21 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A1ll=20Gu=C3=B0j=C3=B3n=20Sigur=C3=B0sson?= Date: Fri, 3 Sep 2010 00:03:53 +0000 Subject: [PATCH] --- check_hparray/trunk/check_hpacucli.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/check_hparray/trunk/check_hpacucli.py b/check_hparray/trunk/check_hpacucli.py index c853121..fe221bc 100644 --- a/check_hparray/trunk/check_hpacucli.py +++ b/check_hparray/trunk/check_hpacucli.py @@ -187,8 +187,12 @@ def check_controllers(): cache_status = check(i, 'Cache Status' ) status = max(status, cache_status) - controller_serial = i['Serial Number'] - cache_serial = i['Cache Serial Number'] + controller_serial = 'n/a' + cache_serial = 'n/a' + if i.has_key('Serial Number'): + controller_serial = i['Serial Number') + if i.has_key('Cache Serial Number'): + cache_serial = i['Cache Serial Number'] add_long ( "%s" % (i['name']) ) add_long( "- Controller Status: %s (sn: %s)" % ( state[controller_status], controller_serial ) ) add_long( "- Cache Status: %s (sn: %s)" % ( state[cache_status], cache_serial ) )