Module: check_mk
Branch: master
Commit: 94c9cc7980c6e34c6fcb99290e3dcaa6e2f57df2
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=94c9cc7980c6e3…
Author: Simon Betz <si(a)mathias-kettner.de>
Date: Fri Aug 26 09:48:49 2016 +0200
3781 FIX ipmi: made check more robust against incomplete datasets
---
.werks/3781 | 10 ++++++++++
ChangeLog | 1 +
checks/ipmi | 52 ++++++++++++++++++++++++++++++++++++++++------------
3 files changed, 51 insertions(+), 12 deletions(-)
diff --git a/.werks/3781 b/.werks/3781
new file mode 100644
index 0000000..02a3f9d
--- /dev/null
+++ b/.werks/3781
@@ -0,0 +1,10 @@
+Title: ipmi: made check more robust against incomplete datasets
+Level: 1
+Component: checks
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.4.0i1
+Date: 1472197703
+
+
diff --git a/ChangeLog b/ChangeLog
index faa9b37..274b00f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -356,6 +356,7 @@
* 3766 FIX: palo_alto_sessions: Fixed possible division by zero error
* 3769 FIX: cisco_temperature: Fixed exception in case of empty SNMP data received
from device
* 3770 FIX: win_dhcp_pools: Fixed crash in case of empty DHCP pools
+ * 3781 FIX: ipmi: made check more robust against incomplete datasets
Multisite:
* 3187 notification view: new filter for log command via regex
diff --git a/checks/ipmi b/checks/ipmi
index c660fcd..5cc1381 100644
--- a/checks/ipmi
+++ b/checks/ipmi
@@ -112,6 +112,32 @@
# PS1 Status | C8h | ok | 10.1 | Presence detected, Failure detected <= NOT
OK !!
# PS2 Status | C9h | ok | 10.2 | Presence detected
+# broken
+# <<<ipmi:cached(1472175405,300)>>>
+# 01-Inlet_Ambient 18.000 degrees_C ok na na na na 42.000 46.000
+# 02-CPU_1 40.000 degrees_C ok na na na na 70.000 na
+# 03-CPU_2 40.000 degrees_C ok na na na na 70.000 na
+# 04-DIMM_P1_1-3 32.000 degrees_C ok na na na na 87.000 na
+# 05-DIMM_P1_4-6 32.000 degrees_C ok na na na na 87.000 na
+# 06-DIMM_P2_1-3 27.000 degrees_C ok na na na na 87.000 na
+# 07-DIMM_P2_4-6 26.000 degrees_C ok na na na na 87.000 na
+# 09-Chipset 47.000 degrees_C ok na na na na 105.000 na
+# 10-VR_P1 32.000 degrees_C ok na na na na 115.000 120.000
+# 11-VR_P2 27.000 degrees_C ok na na na na 115.000 120.000
+# 12-VR_P1_Zone 27.000 degrees_C ok na na na na 80.000 85.000
+# 13-VR_P2_Zone 25.000 degrees_C ok na na na na 80.000 85.000
+# 14-VR_P1_Mem 33.000 degrees_C ok na na na na 115.000 120.000
+# 15-VR_P2_Mem 23.000 degrees_C ok na na na na 115.000 120.000
+# 16-VR_P1Mem_Zone 32.000 degrees_C ok na na na na 80.000 85.000
+# 17-VR_P2Mem_Zone 22.000 degrees_C ok na na na na 80.000 85.000
+# 18-HD_Controller 57.000 degrees_C ok na na na na 90.000 na
+# 19-Supercap 32.000 degrees_C ok na na na na 65.000 na
+# 21-PCI_Zone 30.000 degrees_C ok na na na na 80.000 85.000
+# 23-I/O_1_Zone 28.000 degrees_C ok na na na na 80.000 85.000
+# 26-I/O_LOM 40.000 degrees_C ok na na na na 100.000 na
+# 27-Sys_Exhaust 31.000 degrees_C ok na na na na 80.000 85.000
+# PS3_Inpu
+
ipmi_summarize = True
ipmi_ignore_nr = False # set to True in order to ignore entries with state 'nr'
@@ -146,18 +172,20 @@ def parse_ipmi(info):
for section in [ ipmi_info, ipmi_discrete_info ]:
if section:
for line in section:
- # Compatible with older check versions
- name = line[0].strip().replace(" ", "_")
- line = [ name ] + map(lambda x: x.strip(), line[1:])
-
- # Discrete sensors have no values
- if len(line) <= 5:
- state = line[2]
- if line[4]:
- state += " (%s)" % line[4]
- line = [line[0], None, None, state, None, None, None, None, None,
None]
-
- parsed.append(line)
+ if len(line) >= 2:
+ # Compatible with older check versions
+ name = line[0].strip().replace(" ", "_")
+ line = [ name ] + map(lambda x: x.strip(), line[1:])
+
+ # Discrete sensors have no values
+ if len(line) == 5:
+ state = line[2]
+ if line[4]:
+ state += " (%s)" % line[4]
+ line = [line[0], None, None, state, None, None, None, None, None,
None]
+
+ if len(line) == 10:
+ parsed.append(line)
return parsed