Module: check_mk
Branch: master
Commit: 2576a0dba819083420b7a7c9f3693383d2419f84
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=2576a0dba81908…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Thu Jun 20 14:22:58 2013 +0200
Some cleanups in new thermal check
---
ChangeLog | 2 +-
agents/check_mk_agent.linux | 2 +-
checks/thermal | 12 ++++++------
3 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index e1b957b..318118c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -29,7 +29,7 @@
* cluster hosts: removed agent version output from Check_MK service (this
was misleading for different agent versions on multiple nodes)
* job check: better handling of unexpected agent output
- * thermal: Added check for linux thermal sensors (e.g. acpi)
+ * lnx_thermal: Added check for linux thermal sensors (e.g. acpi)
Multisite:
* User accounts can now be locked after a specified amount of auth
diff --git a/agents/check_mk_agent.linux b/agents/check_mk_agent.linux
index 724a777..d956815 100755
--- a/agents/check_mk_agent.linux
+++ b/agents/check_mk_agent.linux
@@ -465,7 +465,7 @@ fi
# Gather thermal information provided e.g. by acpi
# At the moment only supporting thermal sensors
if ls /sys/class/thermal/thermal_zone* >/dev/null 2>&1; then
- echo '<<<thermal>>>'
+ echo '<<<lnx_thermal>>>'
for F in /sys/class/thermal/thermal_zone*; do
echo -n "${F##*/} "
cat $F/{mode,type,temp,trip_point_*} | tr \\n " "
diff --git a/checks/thermal b/checks/thermal
index e9435ee..b22a849 100644
--- a/checks/thermal
+++ b/checks/thermal
@@ -24,17 +24,17 @@
# to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
# Boston, MA 02110-1301 USA.
-# <<<thermal>>>
+# <<<lnx_thermal>>>
# thermal_zone0 enabled acpitz 57000 127000 critical
# thermal_zone1 enabled acpitz 65000 100000 critical 95500 passive
-# <<<thermal>>>
+# <<<lnx_thermal>>>
# thermal_zone0 enabled acpitz 47000 90000 critical 79000 passive
-def inventory_thermal(info):
+def inventory_lnx_thermal(info):
return [ (l[0].replace('thermal_zone', ''), None) for l in info ]
-def check_thermal(item, params, info):
+def check_lnx_thermal(item, params, info):
for line in info:
if line[0].replace('thermal_zone', '') == item:
# ['thermal_zone0', 'enabled', 'acpitz',
'51000', '90000', 'critical', '79000', 'passive']
@@ -62,9 +62,9 @@ def check_thermal(item, params, info):
return (state, 'Temperature is %dC%s' % (cur, detail_txt), [ (
'temperature', cur ) ])
return (3, 'No data found for sensor "thermal_zone%s"' % item)
-check_info['thermal'] = {
+check_info['lnx_thermal'] = {
"inventory_function" : inventory_thermal,
"check_function" : check_thermal,
- "service_description" : "Thermal Sensor %s",
+ "service_description" : "Temperature %s",
"has_perfdata" : True,
}