Module: check_mk
Branch: master
Commit: 84a355cdffd0fc6848820238222b7699867ef656
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=84a355cdffd0fc…
Author: Simon Betz <si(a)mathias-kettner.de>
Date: Tue Aug 9 11:02:04 2016 +0200
3772 FIX ipmi_sensors: fixed missing states
---
.werks/3772 | 10 ++++++++++
ChangeLog | 1 +
checks/ipmi_sensors | 16 ++++++++--------
3 files changed, 19 insertions(+), 8 deletions(-)
diff --git a/.werks/3772 b/.werks/3772
new file mode 100644
index 0000000..b857510
--- /dev/null
+++ b/.werks/3772
@@ -0,0 +1,10 @@
+Title: ipmi_sensors: fixed missing states
+Level: 1
+Component: checks
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.4.0i1
+Date: 1470733291
+
+
diff --git a/ChangeLog b/ChangeLog
index 05ceab6..e4e6329 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -327,6 +327,7 @@
* 3734 FIX: esx_vsphere_hostsystem.cpu_usage esx_vsphere_hostsystem.mem_usage
esx_vsphere_hostsystem.maintenance: Fixed exception when needed data is missing
* 3759 FIX: cpu.loads: Fixed possible crash on missing data
* 3715 FIX: agent_ipmi_sensors: fixed error handling
+ * 3772 FIX: ipmi_sensors: fixed missing states
Multisite:
* 3187 notification view: new filter for log command via regex
diff --git a/checks/ipmi_sensors b/checks/ipmi_sensors
index 43a8412..87254f8 100644
--- a/checks/ipmi_sensors
+++ b/checks/ipmi_sensors
@@ -76,7 +76,6 @@
# 875 Power_Supply_PS_Status NA_NA_(NA/NA) [Presence_detected]
-
def inventory_freeipmi(info):
return [ (line[1], "", None) for line in info
if not ( line[-1] in ['[Unknown]', '[NA]'] or
@@ -131,14 +130,15 @@ def check_freeipmi(item, _no_params, info):
perfdata = []
infotext = "Current value %.1f%s%s" % (current, unit,
levelstext)
- if status == "OK" \
- or status == "Entity_Present" \
- or status.endswith("is_connected") \
- or status.endswith("Presence_detected") \
- or status == "battery_presence_detected" \
- or status == "Drive_Presence" \
- or status.startswith("Fully_Redundant"):
+
+ if status in [ "OK", "Entity_Present",
"battery_presence_detected",
+ "Drive_Presence", "transition_to_Running",
"Device_Enabled" ] or \
+ status.startswith("Fully_Redundant") or \
+ status.endswith("is_connected") or \
+ status.endswith("Presence_detected") or \
+ status.endswith("Device_Present"):
return (0, infotext, perfdata)
+
else:
return (2, infotext, perfdata)