Module: check_mk
Branch: master
Commit: f415ed4305e5752e26fcc14e0afc1a490cc8b3f1
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=f415ed4305e575…
Author: Bastian Kuhn <bk(a)mathias-kettner.de>
Date: Tue Jun 23 11:05:00 2015 +0200
#1259 wut_webtherm: Check now uses the Check_MK defaults for temperature checks
This means that the Service name is now "Temperature" and the Output fits to all
other temperature checks.
Also the check now uses the new temperature WATO rule and the old rules no longer apply.
---
.werks/1259 | 10 ++++++++++
ChangeLog | 2 ++
checks/wut_webtherm | 40 +++++++++++++++++++---------------------
3 files changed, 31 insertions(+), 21 deletions(-)
diff --git a/.werks/1259 b/.werks/1259
new file mode 100644
index 0000000..ece8b03
--- /dev/null
+++ b/.werks/1259
@@ -0,0 +1,10 @@
+Title: wut_webtherm: Check now uses the Check_MK defaults for temperature checks
+Level: 1
+Component: checks
+Compatible: incomp
+Version: 1.2.7i2
+Date: 1435050105
+Class: feature
+
+This means that the Service name is now "Temperature" and the Output fits to
all other temperature checks.
+Also the check now uses the new temperature WATO rule and the old rules no longer apply.
diff --git a/ChangeLog b/ChangeLog
index 5eda13c..29a789e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -25,6 +25,8 @@
* 2126 cisco_ace_rserver: new check to monitor real servers of Cisco ACE servers
* 2235 lnx_quota: Extended linux quota check with group quota check...
* 2222 citrix_serverload: Load now formatted in percent, correctly treat license
error...
+ * 1259 wut_webtherm: Check now uses the Check_MK defaults for temperature checks...
+ NOTE: Please refer to the migration notes!
* 2323 FIX: df: Fix new graphs for all filesystem checks in case of existing inode
information
* 2305 FIX: agent_vsphere, esx_vsphere_sensors: now able to handle sensor names with
semicolon...
* 2118 FIX: aix_sap_processlist: agent plugin now is more general to deal with
various AIX versions...
diff --git a/checks/wut_webtherm b/checks/wut_webtherm
index 8a86f8f..622a649 100644
--- a/checks/wut_webtherm
+++ b/checks/wut_webtherm
@@ -29,23 +29,20 @@ wut_webtherm_defaultlevels = (30, 35)
def inventory_webtherm(info):
# line[0] is 1.1, 2.1, 3.1, 6.1, 8.1, 16.1 or 18.1 depending on MIB variant. We chop
# of the first part in order to get independent of that.
- return [ (line[0].split(".")[1], "wut_webtherm_defaultlevels")
for
- line in info if len(line) == 2 ]
+ for line in info:
+ if len(line) == 2:
+ temp = float(line[1].replace(",", "."))
+ # If greater then 75 it can't be a temperature sensor.
+ # Maybe humidity
+ if temp > 75:
+ continue
+ yield (line[0].split(".")[1],
"wut_webtherm_defaultlevels")
def check_webtherm(item, params, info):
for line in info:
if line[0].split(".")[1] == item:
temp = float(line[1].replace(",", "."))
- warn, crit = params
- perfdata = [ ("temp", temp, warn, crit) ]
- infotext = "%.1f C (warn/crit at %.1f/%.1f C)" % (temp, warn,
crit)
- if temp >= crit:
- return (2, infotext, perfdata)
- elif temp >= warn:
- return (1, infotext, perfdata)
- else:
- return (0, infotext, perfdata)
- return (3, "No sensor found")
+ return check_temperature(temp, params)
def detect_webtherm(oid):
return oid(".1.3.6.1.2.1.1.2.0") in \
@@ -60,14 +57,15 @@ def detect_webtherm(oid):
".1.3.6.1.4.1.5040.1.2.18" ]
check_info["wut_webtherm"] = {
- 'check_function': check_webtherm,
- 'inventory_function': inventory_webtherm,
- 'service_description': 'Thermograph Sensor %s',
- 'has_perfdata': True,
- 'snmp_info': ('.1.3.6.1.4.1.5040.1.2',
- ['1', '2', '3', '6', '7', '8',
'9', '16', '18'],
- ['1.2.1.1', '1.3.1.1']
+ 'check_function' : check_webtherm,
+ 'inventory_function' : inventory_webtherm,
+ 'service_description' : 'Temperature %s',
+ 'has_perfdata' : True,
+ 'snmp_info' : ('.1.3.6.1.4.1.5040.1.2',
+ ['1', '2', '3', '6',
'7', '8', '9', '16', '18'],
+ ['1.2.1.1', '1.3.1.1']
),
- 'snmp_scan_function': detect_webtherm,
- 'group': 'room_temperature',
+ 'snmp_scan_function' : detect_webtherm,
+ 'group' : 'temperature',
+ 'includes' : [ 'temperature.include' ],
}