Module: check_mk
Branch: master
Commit: b8c1e0365c03bc40967094b8c8290fd8dc331a72
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=b8c1e0365c03bc…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Thu Jan 17 12:24:08 2013 +0100
FIX: megaraid_bbu - Handle missing charge information (ignoring them)
---
ChangeLog | 1 +
checks/megaraid_bbu | 6 ++++--
2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index b00924e..e09e3fe 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -12,6 +12,7 @@
* Logwatch: unknown eventlog level ('u') from windows agent treated as
warning
* FIX: logwatch_ec: Added state undefined as priority
* Add: mailman_lists - New check to gather statistics of mailman mailinglists
+ * FIX: megaraid_bbu - Handle missing charge information (ignoring them)
Multisite:
* FIX: Fixed rendering of dashboard globes in opera
diff --git a/checks/megaraid_bbu b/checks/megaraid_bbu
index be2f9b2..dda2c4c 100644
--- a/checks/megaraid_bbu
+++ b/checks/megaraid_bbu
@@ -79,8 +79,10 @@ def check_megaraid_bbu(item, _no_params, info):
broken = []
state = 0
# get current charge level
- charge = (", Charge is %s" % controller['Relative State of
Charge'])
-
+ if 'Relative State of Charge' not in controller:
+ charge = ", No charge information were reported for this controller"
+ else:
+ charge = ", Charge is %s" % controller['Relative State of
Charge']
# verify defined important parameters to current level
for varname, (refvalue, refstate) in megaraid_bbu_refvalues.items():