Module: check_mk
Branch: master
Commit: 6fd8261782137e7186f848bcae90943ecb347278
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=6fd8261782137e…
Author: Sven Rueß <sr(a)mathias-kettner.de>
Date: Tue Sep 13 11:11:15 2016 +0200
3883 kentix_humidity, kentix_temp: Added support of MultiSensor-LAN and MultiSensor-RACK
---
.werks/3883 | 8 ++++++++
ChangeLog | 1 +
checkman/kentix_humidity | 7 ++-----
checkman/kentix_temp | 33 ++-------------------------------
checks/kentix_humidity | 26 +++++++++++++-------------
checks/kentix_temp | 29 ++++++++++++++++-------------
6 files changed, 42 insertions(+), 62 deletions(-)
diff --git a/.werks/3883 b/.werks/3883
new file mode 100644
index 0000000..a09eca7
--- /dev/null
+++ b/.werks/3883
@@ -0,0 +1,8 @@
+Title: kentix_humidity, kentix_temp: Added support of MultiSensor-LAN and
MultiSensor-RACK
+Level: 1
+Component: checks
+Compatible: compat
+Version: 1.4.0i1
+Date: 1473757772
+Class: feature
+
diff --git a/ChangeLog b/ChangeLog
index db6419c..5e6097e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -160,6 +160,7 @@
* 3744 synology_info: Now also displays OS version
* 3799 agent_netapp: No longer requires the files NaServer/NaElements. Reduced CPU
usage by 2/3...
* 3872 mcafee_webgateway, mcafee_webgateway_misc: new checks which monitor some
statistics of McAfee web gateway devices
+ * 3883 kentix_humidity, kentix_temp: Added support of MultiSensor-LAN and
MultiSensor-RACK
* 3073 FIX: windows agent: relative paths to mrpe scripts are now treated as relative
to the agent installation directory...
* 3061 FIX: mk_jolokia: Fixed debugging of the agent plugin
* 3074 FIX: windows agent: fixed incorrect values for 32-bit performance counters
diff --git a/checkman/kentix_humidity b/checkman/kentix_humidity
index ee70cc8..f3f0455 100644
--- a/checkman/kentix_humidity
+++ b/checkman/kentix_humidity
@@ -1,13 +1,10 @@
-title: Kentix MultiSensor-RACK: Humidity Sensor
+title: Kentix MultiSensor: Humidity Sensor
agents: snmp
catalog: hw/environment/kentix
license: GPL
distribution: check_mk
description:
- This check monitors the humidity measured by the Kentix MultiSensor-RACK device.
+ This check monitors the humidity measured by the Kentix MultiSensor-LAN or
MultiSensor-RACK device.
No limits are set in the check, since limits are configured in the device
itself. These limits are taken as the lower and upper warning levels of the check.
-
-perfdata:
- One variable: the humidity
diff --git a/checkman/kentix_temp b/checkman/kentix_temp
index c47d2e3..3807d66 100644
--- a/checkman/kentix_temp
+++ b/checkman/kentix_temp
@@ -1,39 +1,10 @@
-title: Kentix MultiSensor-RACK: Temperature Sensor
+title: Kentix MultiSensor: Temperature Sensor
agents: snmp
catalog: hw/environment/kentix
license: GPL
distribution: check_mk
description:
- This check monitors the temperature measured by the Kentix MultiSensor-RACK device.
+ This check monitors the temperature measured by the Kentix MultiSensor-LAN or
MultiSensor-RACK device.
The device allows to configure an upper and lower warning level. These are used as
device critical levels.
-
-item:
- "Rack"
-
-perfdata:
- One variable: the temperature in °C
-
-[parameters]
-parameters(dict): This checks parameters are a dictionary with the
- following (optional) keys:
-
- {"levels"}: A tuple (warn, crit) containing the upper levels. Default: (70,
80)
-
- {"levels_lower"}: A tuple (warn, crit) containing the lower levels. No
defaults.
-
- {"output_unit"}: "c", "f" or "k", the check
will output the temperature in the
- specified unit. If this is not set, output is in degrees Celsius.
-
- {"input_unit"}: "c, "f" or "k". By default, the
check interprets the sensor value
- according to the unit sent by the device. This key allows to override that. Tread
- lightly, as this may lead to a misinterpreted temperature. Should only be used if
- the device reports its unit incorrectly.
-
- {"device_levels_handling"}: How the check treats the device's internal
levels
- versus the ones you specify yourself. The following options are supported:
"best"
- results in the best status between yours and the device's levels, "worst"
in the
- worst, "usr" ignore's the device's levels, "dev" ignores
yours, usrdefault and
- devdefault uses your/the devices set of levels if present, otherwise the other
- respectively. Default setting is "devdefault"
diff --git a/checks/kentix_humidity b/checks/kentix_humidity
index 178ecf3..ec14749 100644
--- a/checks/kentix_humidity
+++ b/checks/kentix_humidity
@@ -29,6 +29,7 @@ def inventory_kentix_humidity(info):
return [ (None, None ) ]
def check_kentix_humidity(_no_item, _no_params, info):
+ info[0][0] = info[0][0].split('.', 3)[-1]
value, lower_warn, upper_warn, alarm, text = info[0]
temp = float(value)/10
perfdata = [ ("humidity", temp, lower_warn+":"+upper_warn ) ]
@@ -43,17 +44,16 @@ def check_kentix_humidity(_no_item, _no_params, info):
return state, infotext, perfdata
check_info["kentix_humidity"] = {
- 'check_function': check_kentix_humidity,
- 'inventory_function': inventory_kentix_humidity,
- 'service_description': 'Humidity',
- 'has_perfdata': True,
- 'snmp_info': ('.1.3.6.1.4.1.37954.3.1.2',
- ['1', # humidityValue
- '2', # humidityMin
- '3', # humidityMax
- '4', # humidityAlarm, not used
- '5', # humidityAlarmtext
- ]
- ),
- "snmp_scan_function" : lambda oid:
oid(".1.3.6.1.2.1.1.2.0").startswith(".1.3.6.1.4.1.332.11.6"),
+ 'check_function' : check_kentix_humidity,
+ 'inventory_function' : inventory_kentix_humidity,
+ 'service_description' : 'Humidity',
+ 'has_perfdata' : True,
+ 'snmp_info' : ('.1.3.6.1.4.1.37954', ['2.1.2',
'3.1.2'],
+ ['1', # humidityValue
+ '2', # humidityMin
+ '3', # humidityMax
+ '4', # humidityAlarm, not used
+ '5', # humidityAlarmtext
+ ]),
+ "snmp_scan_function" : lambda oid:
oid(".1.3.6.1.2.1.1.2.0").startswith(".1.3.6.1.4.1.332.11.6"),
}
diff --git a/checks/kentix_temp b/checks/kentix_temp
index c87831f..e0cd2f1 100644
--- a/checks/kentix_temp
+++ b/checks/kentix_temp
@@ -25,10 +25,13 @@
# Boston, MA 02110-1301 USA.
def inventory_kentix_temp(info):
- if info:
- return [ ("Rack", {} ) ]
+ if info[0][0].startswith('2.1.1'):
+ return [ ('LAN', {} ) ]
+ else:
+ return [ ('Rack', {} ) ]
def check_kentix_temp(item, params, info):
+ info[0][0] = info[0][0].split('.', 3)[-1]
value, lower_warn, upper_warn, alarm, text = info[0]
temp = float(value)/10
@@ -37,17 +40,17 @@ def check_kentix_temp(item, params, info):
dev_levels_lower = (float(lower_warn), float(lower_warn)))
check_info["kentix_temp"] = {
- 'check_function' : check_kentix_temp,
- 'inventory_function' : inventory_kentix_temp,
- 'service_description' : 'Temperature %s',
- 'has_perfdata' : True,
- 'snmp_info' : ('.1.3.6.1.4.1.37954.3.1.1',
- ['1', # temperatureValue
- '2', # temperatureMin
- '3', # temperatureMax
- '4', # temperatureAlarm, not used here
- '5', # temperatureAlarmtext
- ]),
+ 'check_function' : check_kentix_temp,
+ 'inventory_function' : inventory_kentix_temp,
+ 'service_description' : 'Temperature %s',
+ 'has_perfdata' : True,
+ 'snmp_info' : ('.1.3.6.1.4.1.37954', ['2.1.1',
'3.1.1'],
+ ['1', # temperatureValue
+ '2', # temperatureMin
+ '3', # temperatureMax
+ '4', # temperatureAlarm, not used here
+ '5', # temperatureAlarmtext
+ ]),
"snmp_scan_function" : lambda oid:
oid(".1.3.6.1.2.1.1.2.0").startswith(".1.3.6.1.4.1.332.11.6"),
"group" : "temperature",
"includes" : [ "temperature.include" ],