Module: check_mk
Branch: master
Commit: f7ee98e44637538fe3741118e70c1b52db4ec477
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=f7ee98e4463753…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Thu Dec 4 12:13:58 2014 +0100
megaraid_bbu: fix exception if Full Charge Capacity is unknown
---
checks/megaraid_bbu | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/checks/megaraid_bbu b/checks/megaraid_bbu
index baa07cc..ca7d8ac 100644
--- a/checks/megaraid_bbu
+++ b/checks/megaraid_bbu
@@ -86,8 +86,9 @@ def check_megaraid_bbu(item, _no_params, info):
if 'Relative State of Charge' not in controller:
charge = ", No charge information reported for this controller"
else:
- charge = ", Charge is %s, Capacity is %s" % \
- (controller['Relative State of Charge'], controller['Full
Charge Capacity'])
+ charge = ", Charge is %s" % controller['Relative State of
Charge']
+ if 'Full Charge Capacity' in controller:
+ charge += ", Charge is %s, Capacity is %s" % controller['Full
Charge Capacity']
# verify defined important parameters to current level
for varname, (refvalue, refstate) in megaraid_bbu_refvalues.items():