Module: check_mk
Branch: master
Commit: 85e499e696cc5b59d6388313d8dc326caf6c4515
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=85e499e696cc5b…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Thu Dec 11 08:46:56 2014 +0100
#1739 FIX lnx_thermal: Be more compatible to thermal devices which report no
"type"
---
.werks/1739 | 9 +++++++++
ChangeLog | 1 +
checks/lnx_thermal | 13 +++++++++++++
3 files changed, 23 insertions(+)
diff --git a/.werks/1739 b/.werks/1739
new file mode 100644
index 0000000..74c4ad9
--- /dev/null
+++ b/.werks/1739
@@ -0,0 +1,9 @@
+Title: lnx_thermal: Be more compatible to thermal devices which report no
"type"
+Level: 1
+Component: checks
+Compatible: compat
+Version: 1.2.5i7
+Date: 1418283980
+Class: fix
+
+
diff --git a/ChangeLog b/ChangeLog
index d4f200b..1e284e8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -159,6 +159,7 @@
* 1737 FIX: mk_sap: Working around garbled SAP state file when multiple instances
were running parallel
* 1738 FIX: oracle_instance: Be compatible to old oracle agent outputs
* 1751 FIX: winperf_ts_sessions: try to fix invalid number of active and inactive
sessions...
+ * 1739 FIX: lnx_thermal: Be more compatible to thermal devices which report no
"type"
Multisite:
* 1508 Allow input of plugin output and perfdata when faking check results...
diff --git a/checks/lnx_thermal b/checks/lnx_thermal
index 22ad645..ba0edcd 100644
--- a/checks/lnx_thermal
+++ b/checks/lnx_thermal
@@ -31,6 +31,10 @@
# <<<lnx_thermal>>>
# thermal_zone0 enabled acpitz 47000 90000 critical 79000 passive
+# <<<lnx_thermal>>>
+# thermal_zone0 enabled acpitz 38000 98000 critical
+# thermal_zone1 pkg-temp-0 44000 0 passive 0 passive
+
def inventory_lnx_thermal(info):
return [ (l[0].replace('thermal_zone', ''), None) for l in info ]
@@ -41,6 +45,15 @@ def check_lnx_thermal(item, params, info):
state = 0
tp_reached = []
+ # Some devices report an empty value for the 3rd field (type). Trying to fix
those lines.
+ # -> thermal_zone1 pkg-temp-0 44000 0 passive 0 passive
+ try:
+ int(line[2])
+ int(line[3])
+ line = line[:2] + [''] + line[2:]
+ except:
+ pass # -> regular line
+
# convert values from millidegree
cur = int(line[3]) / 1000