Module: check_mk
Branch: master
Commit: a47f9808dc2703a34980b5be42c107a90634a77e
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=a47f9808dc2703…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Thu Jun 20 17:36:18 2013 +0200
hwg_temp: WATO rule, man page, pnp graph, Perf-O-Meter
---
ChangeLog | 2 ++
checkman/hwg_temp | 22 +++++++++++++++++++++
checks/hwg_temp | 37 ++++++++++++++++++++---------------
pnp-templates/check_mk-hwg_temp.php | 1 +
web/plugins/perfometer/check_mk.py | 1 +
5 files changed, 47 insertions(+), 16 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index e450226..14fa65c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -30,6 +30,8 @@
was misleading for different agent versions on multiple nodes)
* job check: better handling of unexpected agent output
* lnx_thermal: Added check for linux thermal sensors (e.g. acpi)
+ * hwg_temp: Make WATO-Rule "Room Temperature" match, add man page, graph
+ and Perf-O-Meter
Multisite:
* User accounts can now be locked after a specified amount of auth
diff --git a/checkman/hwg_temp b/checkman/hwg_temp
new file mode 100644
index 0000000..ffd294f
--- /dev/null
+++ b/checkman/hwg_temp
@@ -0,0 +1,22 @@
+title: HWg-STE Ethernet thermometer
+agents: snmp
+author: Mathias Kettner <mk(a)mathias-kettner.de>
+license: GPL
+distribution: check_mk
+description:
+ This check monitors the environmental temperature via a
+ HWg-STE Ethernet thermometer.
+
+item:
+ The name of the sensor "a string".
+
+perfdata:
+ One variable: the current temperature.
+
+inventory:
+ All available temperature sensors are automatically inventorized.
+
+[parameters]
+warn(int): Warning level for the temperature.
+crit(int): Critical level for the temperature.
+
diff --git a/checks/hwg_temp b/checks/hwg_temp
index 02e382b..3704b64 100644
--- a/checks/hwg_temp
+++ b/checks/hwg_temp
@@ -24,8 +24,13 @@
# to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
# Boston, MA 02110-1301 USA.
+
hwg_temp_defaultlevels = (23, 25)
+def inventory_hwg_temp(info):
+ return [ (line[0], "hwg_temp_defaultlevels" ) for line in info if
int(line[2]) != 0]
+
+
def check_hwg_temp(item, params, info):
warn, crit = params
status_text = {
@@ -67,24 +72,24 @@ def check_hwg_temp(item, params, info):
return (3, "Sensor %s not found in SNMP data %s" % (item) )
check_info['hwg_temp'] = {
- "check_function" : check_hwg_temp,
- "inventory_function" : lambda info: [ (line[0], hwg_temp_defaultlevels )
for line in info if int(line[2]) != 0] ,
- "service_description" : "Temperature %s",
- "has_perfdata" : True,
+ "check_function" : check_hwg_temp,
+ "inventory_function" : inventory_hwg_temp,
+ "service_description" : "Temperature %s",
+ "has_perfdata" : True,
"snmp_info" : (".1.3.6.1.4.1.21796.4.1.3", [# sensors index
(1-2)
- "1.1",
- # sensor name string
- "1.2",
- # unit state: 0=Invalid, 1=Normal,
2=OutOfRangeLo, 3=OutOfRangeHi, 4=AlarmLo, 5=AlarmHi
- "1.3",
- # current value string
- "1.4",
- # current value*10 integer
- "1.5",
- # sensor unit integer 0=unknown, 1=°C,
2=°F, 3=°K, 4=%
- "1.7",
+ "1.1",
+ # sensor name string
+ "1.2",
+ # unit state: 0=Invalid, 1=Normal, 2=OutOfRangeLo, 3=OutOfRangeHi, 4=AlarmLo,
5=AlarmHi
+ "1.3",
+ # current value string
+ "1.4",
+ # current value*10 integer
+ "1.5",
+ # sensor unit integer 0=unknown, 1=°C, 2=°F, 3=°K, 4=%
+ "1.7",
]),
"snmp_scan_function" : lambda oid: "hwg" in
oid(".1.3.6.1.2.1.1.1.0").lower(),
- "group" : "hw_temperature",
+ "group" : "room_temperature",
}
diff --git a/pnp-templates/check_mk-hwg_temp.php b/pnp-templates/check_mk-hwg_temp.php
new file mode 120000
index 0000000..a7f1e24
--- /dev/null
+++ b/pnp-templates/check_mk-hwg_temp.php
@@ -0,0 +1 @@
+check_mk-cmctc.temp.php
\ No newline at end of file
diff --git a/web/plugins/perfometer/check_mk.py b/web/plugins/perfometer/check_mk.py
index efdeed5..047bf6b 100644
--- a/web/plugins/perfometer/check_mk.py
+++ b/web/plugins/perfometer/check_mk.py
@@ -275,6 +275,7 @@ perfometers["check_mk-hp_proliant_temp"] =
perfometer_temperature
perfometers["check_mk-akcp_sensor_temp"] = perfometer_temperature
perfometers["check_mk-fsc_temp"] = perfometer_temperature
perfometers["check_mk-viprinet_temp"] = perfometer_temperature
+perfometers["check_mk-hwg_temp"] = perfometer_temperature
def perfometer_blower(row, check_command, perf_data):
rpm = saveint(perf_data[0][1])