Module: check_mk
Branch: master
Commit: 0d6e828d1ecdc364b92d653c6b4f674f864cdd99
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=0d6e828d1ecdc3…
Author: Moritz Kiemer <mo(a)mathias-kettner.de>
Date: Thu Aug 30 15:46:46 2018 +0200
6217 FIX mgmt_ipmi_sensors: Fix wrong state for IPMI Sensor warnings
Previously IPMI Sensors have been mapped to CRIT when they where
above the "non-critical" but below the "critical" threshold.
This as been fixed to WARN.
FEED-943
Change-Id: I25e52b2c405b8386d6471f8217e925956ed5f5ca
---
.werks/6217 | 12 ++++++++++++
checks/ipmi_sensors.include | 13 +++++++++++--
2 files changed, 23 insertions(+), 2 deletions(-)
diff --git a/.werks/6217 b/.werks/6217
new file mode 100644
index 0000000..418c056
--- /dev/null
+++ b/.werks/6217
@@ -0,0 +1,12 @@
+Title: mgmt_ipmi_sensors: Fix wrong state for IPMI Sensor warnings
+Level: 1
+Component: checks
+Compatible: compat
+Edition: cre
+Version: 1.6.0i1
+Date: 1535636520
+Class: fix
+
+Previously IPMI Sensors have been mapped to CRIT when they where
+above the "non-critical" but below the "critical" threshold.
+This as been fixed to WARN.
diff --git a/checks/ipmi_sensors.include b/checks/ipmi_sensors.include
index 9930d54..7b36483 100644
--- a/checks/ipmi_sensors.include
+++ b/checks/ipmi_sensors.include
@@ -189,8 +189,17 @@ def inventory_freeipmi(parsed):
def freeipmi_status_txt_mapping(status_txt):
if status_txt is None:
return 3
- elif status_txt in [
- "OK", "Entity Present", "battery presence
detected",
+
+ state = {"ok": 0,
+ "warning": 1,
+ "critical": 2, "failed": 2,
+ "unknown": 3,
+ }.get(status_txt.lower())
+ if state is not None:
+ return state
+
+ if status_txt in [
+ "Entity Present", "battery presence detected",
"Drive Presence", "transition to Running", "Device
Enabled",
"System full operational, working", "System Restart",
] or \