Module: check_mk
Branch: master
Commit: 5fd95ad9e389749d42894b6850ca1a8aa430eb97
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=5fd95ad9e38974…
Author: Simon Betz <si(a)mathias-kettner.de>
Date: Tue Jun 12 09:26:08 2018 +0200
6132 FIX ipmi_sensors.include: Treat states 'S0G0' (System full operational,
working) and 'System Restart' as 'OK'
Change-Id: I8aff3bce59ade97b81319b0f8e735af1f3bbacfc
---
.werks/6132 | 10 ++++++++++
checks/ipmi_common.include | 2 ++
checks/ipmi_sensors.include | 13 +++++++++----
3 files changed, 21 insertions(+), 4 deletions(-)
diff --git a/.werks/6132 b/.werks/6132
new file mode 100644
index 0000000..2d3a3ec
--- /dev/null
+++ b/.werks/6132
@@ -0,0 +1,10 @@
+Title: ipmi_sensors.include: Treat states 'S0G0' (System full operational,
working) and 'System Restart' as 'OK'
+Level: 1
+Component: checks
+Compatible: compat
+Edition: cre
+Version: 1.6.0i1
+Date: 1528788266
+Class: fix
+
+
diff --git a/checks/ipmi_common.include b/checks/ipmi_common.include
index e568fe8..8a0a65e 100644
--- a/checks/ipmi_common.include
+++ b/checks/ipmi_common.include
@@ -24,6 +24,8 @@
# to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
# Boston, MA 02110-1301 USA.
+#TODO Cleanup the whole status text mapping in
+# ipmi_common.include, ipmi_sensors.include, ipmi
def ipmi_ignore_entry(name, status_txt, rules):
if status_txt is None:
diff --git a/checks/ipmi_sensors.include b/checks/ipmi_sensors.include
index 5c6eb73..e607881 100644
--- a/checks/ipmi_sensors.include
+++ b/checks/ipmi_sensors.include
@@ -113,7 +113,7 @@ def parse_freeipmi(info):
def add_valid_values(values):
for key, value, ty in values:
if value not in [ "NA", "N/A" ]:
- parsed[sensorname][key] = ty(value)
+ instance[key] = ty(value)
parsed = {}
for line in info:
@@ -125,11 +125,13 @@ def parse_freeipmi(info):
status_txt = status_txt[:-1]
if status_txt in [ "NA", "N/A", "Unknown" ] or
"_=_" in status_txt:
status_txt = None
+ elif status_txt == "S0G0":
+ status_txt = "System full operational, working"
else:
status_txt = status_txt.replace("_", " ")
sensorname = stripped_line[1].replace(" ", "_")
- parsed.setdefault(sensorname, {
+ instance = parsed.setdefault(sensorname, {
"value" : None,
"unit" : None,
"status_txt" : status_txt,
@@ -187,8 +189,11 @@ 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",
- "Drive Presence", "transition to Running", "Device
Enabled" ] or \
+ elif status_txt in [
+ "OK", "Entity Present", "battery presence
detected",
+ "Drive Presence", "transition to Running", "Device
Enabled",
+ "System full operational, working", "System Restart",
+ ] or \
status_txt.startswith("Fully Redundant") or \
status_txt.endswith("is connected") or \
status_txt.endswith("Presence detected") or \