Module: check_mk
Branch: master
Commit: 08b23bcc0e7b204303c234e36a05552559274be1
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=08b23bcc0e7b20…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Tue Dec 9 09:25:24 2014 +0100
#1722 FIX lnx_thermal: fix invalid zero temperature if mode file is missing
---
.werks/1722 | 9 +++++++++
ChangeLog | 1 +
agents/check_mk_agent.linux | 1 +
checks/lnx_thermal | 4 ++--
4 files changed, 13 insertions(+), 2 deletions(-)
diff --git a/.werks/1722 b/.werks/1722
new file mode 100644
index 0000000..36978e2
--- /dev/null
+++ b/.werks/1722
@@ -0,0 +1,9 @@
+Title: lnx_thermal: fix invalid zero temperature if mode file is missing
+Level: 1
+Component: checks
+Compatible: compat
+Version: 1.2.5i7
+Date: 1418113501
+Class: fix
+
+
diff --git a/ChangeLog b/ChangeLog
index 51a278d..49b5371 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -132,6 +132,7 @@
* 1713 FIX: check_fstab_mounts: now correctly ignores swap space...
* 1716 FIX: windows_tasks: consider state SCHED_S_TASK_QUEUED (0x00041325) as OK now
* 1721 FIX: dell_om_mem: Handle formerly unhandled situations with multiple
errors...
+ * 1722 FIX: lnx_thermal: fix invalid zero temperature if mode file is missing
Multisite:
* 1508 Allow input of plugin output and perfdata when faking check results...
diff --git a/agents/check_mk_agent.linux b/agents/check_mk_agent.linux
index 5f925e1..0a6eca1 100755
--- a/agents/check_mk_agent.linux
+++ b/agents/check_mk_agent.linux
@@ -586,6 +586,7 @@ if ls /sys/class/thermal/thermal_zone* >/dev/null 2>&1;
then
echo '<<<lnx_thermal>>>'
for F in /sys/class/thermal/thermal_zone*; do
echo -n "${F##*/} "
+ if [ ! -e $F/mode ] ; then echo -n "- " ; fi
cat $F/{mode,type,temp,trip_point_*} | tr \\n " "
echo
done
diff --git a/checks/lnx_thermal b/checks/lnx_thermal
index 6ccde87..22ad645 100644
--- a/checks/lnx_thermal
+++ b/checks/lnx_thermal
@@ -42,11 +42,11 @@ def check_lnx_thermal(item, params, info):
tp_reached = []
# convert values from millidegree
- cur = saveint(line[3]) / 1000
+ cur = int(line[3]) / 1000
# parse trip points
if len(line) > 4:
- trip_points = dict(zip(line[5::2], map(lambda x: saveint(x) / 1000,
line[4::2])))
+ trip_points = dict(zip(line[5::2], map(lambda x: int(x) / 1000,
line[4::2])))
for tp_num, (tp_name, level) in enumerate(trip_points.items()):
# ignore active cooling device trip points (means enabling a fan or
similar)
if tp_name == 'active':