Module: check_mk
Branch: master
Commit: 98e3e3f6dfb9a71dbf03107b0c3e11a7901dbdaa
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=98e3e3f6dfb9a7…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Wed Jan 8 14:13:05 2014 +0100
FIX megaraid_bbu: Fix several false alarms and cases where inventory failed
---
.werks/441 | 10 ++++++++++
ChangeLog | 1 +
checks/megaraid_bbu | 19 ++++++++++++++-----
3 files changed, 25 insertions(+), 5 deletions(-)
diff --git a/.werks/441 b/.werks/441
new file mode 100644
index 0000000..1188e3c
--- /dev/null
+++ b/.werks/441
@@ -0,0 +1,10 @@
+Title: megaraid_bbu: Fix several false alarms and cases where inventory failed
+Level: 1
+Component: checks
+Class: fix
+State: unknown
+Version: 1.2.5i1
+Date: 1389186664
+Targetversion: future
+
+
diff --git a/ChangeLog b/ChangeLog
index a3ae771..b8c4f99 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -80,6 +80,7 @@
* 0439 FIX: postfix_mailq: Linux agent better detects Postfix installation...
* 0440 FIX: heartbeat_crm: Inventory more gracefully handles case where agent output
is invalid...
* 0113 FIX: blade_blades: Now only make inventory for blades that are powered on...
+ * 0441 FIX: megaraid_bbu: Fix several false alarms and cases where inventory failed
* 0442 FIX: dell_om_disks: Treat global host spare disks as OK, instead of WARN...
* 0443 FIX: brocade_fcport: cope with firmware that does not provide speed
information...
* 0322 FIX: timemachine: Check now also works if there are spaces in the name of the
backup volume or the hostname
diff --git a/checks/megaraid_bbu b/checks/megaraid_bbu
index b7e097e..418e171 100644
--- a/checks/megaraid_bbu
+++ b/checks/megaraid_bbu
@@ -38,7 +38,7 @@ megaraid_bbu_refvalues = {
'Charging Status' : ('None', 1), #
nolearn
'Battery State' : ('Operational', 2), #
nolearn
'Learn Cycle Status' : ('OK', 1),
- 'Learn Cycle Active' : ('Yes', 0),
+ 'Learn Cycle Active' : ('No', 0),
'Battery Pack Missing' : ('No', 2),
'Battery Replacement required' : ('No', 1),
'Over Temperature' : ('No', 2),
@@ -49,9 +49,12 @@ megaraid_bbu_refvalues = {
def megaraid_bbu_parse(info):
controllers = {}
+ current_hba = None
for line in info:
- # Format the Agent output
- name, data = " ".join(line).split(":")
+ joined = " ".join(line)
+ if ":" not in joined:
+ continue # skip garbage lines
+ name, data = joined.split(":")
name = name.strip()
data = data.strip()
@@ -59,7 +62,7 @@ def megaraid_bbu_parse(info):
if name in [ "BBU status for Adapter", "BBU status for
Adpater" ]:
current_hba = {}
controllers[data] = current_hba
- else:
+ elif current_hba != None:
# We lose the numerical temperature here
# (same key is used twice in output of megacli)
current_hba[name] = data
@@ -91,7 +94,13 @@ def check_megaraid_bbu(item, _no_params, info):
# to a false result. but people asked for it :>
try:
value = controller[varname]
- if value != refvalue:
+ # Some controllers report "Optimal" instead of
"Operational"
+ if value == "Optimal":
+ pass
+ # Some controllers do not output Temperature: OK and Voltage: OK.
+ elif varname in [ "Temperature", "Voltage" ] and
value[0].isdigit():
+ pass
+ elif value != refvalue:
text = '%s is %s' % (varname, value)
if refstate:
text += ' (%s)' % ("!" * refstate)