Module: check_mk
Branch: master
Commit: 668ad25e2d2860d4570cc922ead7a6a2bfd3037f
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=668ad25e2d2860…
Author: Simon Betz <si(a)mathias-kettner.de>
Date: Mon Aug 3 08:03:45 2015 +0200
fixed missing main check in check kentix_amp_sensors
---
checks/kentix_amp_sensors | 56 ++++++++-------------------------------------
1 file changed, 10 insertions(+), 46 deletions(-)
diff --git a/checks/kentix_amp_sensors b/checks/kentix_amp_sensors
index 5b2a030..c5ed886 100644
--- a/checks/kentix_amp_sensors
+++ b/checks/kentix_amp_sensors
@@ -24,18 +24,6 @@
# to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
# Boston, MA 02110-1301 USA.
-# .--general-------------------------------------------------------------.
-# | _ |
-# | __ _ ___ _ __ ___ _ __ __ _| | |
-# | / _` |/ _ \ '_ \ / _ \ '__/ _` | | |
-# | | (_| | __/ | | | __/ | | (_| | | |
-# | \__, |\___|_| |_|\___|_| \__,_|_| |
-# | |___/ |
-# +----------------------------------------------------------------------+
-
-# kentix-alarmm-pro
-# nr. 7 of 100 sensors |
-# v
# .1.3.6.1.4.1.37954.1.2.7.1.0 RZ1SE-KLIMA-NEU sensor name
# .1.3.6.1.4.1.37954.1.2.7.2.0 159 temperature INTEGER (0..1000)
# .1.3.6.1.4.1.37954.1.2.7.3.0 474 humidity INTEGER (0..1000)
@@ -60,14 +48,6 @@
# 'RZ2SELI1' : { 'smoke': 0, 'humidity': 41.9,
'temp': 15.1, 'leakage':0 }
# }
-
-info_kentix_amp_sensors = [ ( ".1.3.6.1.4.1.37954.1.2", [ "" ]) ]
-
-
-def scan_kentix_amp_sensors(oid):
- return
oid(".1.3.6.1.2.1.1.2.0").startswith(".1.3.6.1.4.1.332.11.6")
-
-
def parse_kentix_amp_sensors(info):
info_flattened = []
@@ -91,14 +71,6 @@ def parse_kentix_amp_sensors(info):
def inventory_kentix_amp_sensors(parsed, params):
return [ (key, params) for key in parsed ]
-
-check_info['kentix_amp_sensors'] = {
- 'parse_function' : parse_kentix_amp_sensors,
- 'snmp_info' : info_kentix_amp_sensors,
- 'snmp_scan_function' : scan_kentix_amp_sensors,
-}
-
-#.
# .--temperature---------------------------------------------------------.
# | _ _ |
# | | |_ ___ _ __ ___ _ __ ___ _ __ __ _| |_ _ _ _ __ ___ |
@@ -107,21 +79,23 @@ check_info['kentix_amp_sensors'] = {
# | \__\___|_| |_| |_| .__/ \___|_| \__,_|\__|\__,_|_| \___| |
# | |_| |
# +----------------------------------------------------------------------+
-
+# | main check |
+# '----------------------------------------------------------------------'
def check_kentix_amp_sensors_temperature(item, params, parsed):
if item in parsed:
return check_temperature(parsed[item]['temp'], params)
-check_info['kentix_amp_sensors.temperature'] = {
- 'inventory_function' : lambda i: inventory_kentix_amp_sensors(i, {}),
+check_info['kentix_amp_sensors'] = {
+ 'parse_function' : parse_kentix_amp_sensors,
+ 'inventory_function' : lambda parsed:
inventory_kentix_amp_sensors(parsed, {}),
'check_function' : check_kentix_amp_sensors_temperature,
'service_description' : 'Temperature %s',
'has_perfdata' : True,
'group' : 'temperature',
- 'snmp_info' : info_kentix_amp_sensors,
- 'snmp_scan_function' : scan_kentix_amp_sensors,
+ 'snmp_info' : [ ( ".1.3.6.1.4.1.37954.1.2", [
"" ]) ],
+ '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"),
'includes' : [ "temperature.include" ],
}
@@ -142,13 +116,11 @@ def check_kentix_amp_sensors_humidity(item, params, parsed):
check_info['kentix_amp_sensors.humidity'] = {
- 'inventory_function' : lambda i: inventory_kentix_amp_sensors(i, {}),
+ 'inventory_function' : lambda parsed:
inventory_kentix_amp_sensors(parsed, {}),
'check_function' : check_kentix_amp_sensors_humidity,
'service_description' : 'Humidity %s',
'has_perfdata' : True,
'group' : 'humidity',
- 'snmp_info' : info_kentix_amp_sensors,
- 'snmp_scan_function' : scan_kentix_amp_sensors,
'includes' : [ "humidity.include" ],
}
@@ -162,8 +134,7 @@ check_info['kentix_amp_sensors.humidity'] = {
# | |
# +----------------------------------------------------------------------+
-
-kentix_amp_sensors_smoke_default_levels = (1, 10)
+kentix_amp_sensors_smoke_default_levels = (1, 5)
def check_kentix_amp_sensors_smoke(item, params, parsed):
@@ -189,16 +160,13 @@ def check_kentix_amp_sensors_smoke(item, params, parsed):
check_info['kentix_amp_sensors.smoke'] = {
- 'inventory_function' : lambda i: inventory_kentix_amp_sensors(i,
"kentix_amp_sensors_smoke_default_levels"),
+ 'inventory_function' : lambda parsed:
inventory_kentix_amp_sensors(parsed,
"kentix_amp_sensors_smoke_default_levels"),
'check_function' : check_kentix_amp_sensors_smoke,
'service_description' : 'Smoke Detector %s',
'has_perfdata' : True,
'group' : 'smoke',
- 'snmp_info' : info_kentix_amp_sensors,
- 'snmp_scan_function' : scan_kentix_amp_sensors,
}
-
#.
# .--leakage-------------------------------------------------------------.
# | _ _ |
@@ -209,7 +177,6 @@ check_info['kentix_amp_sensors.smoke'] = {
# | |___/ |
# +----------------------------------------------------------------------+
-
def check_kentix_amp_sensors_leakage(item, params, parsed):
if item in parsed:
if parsed[item]['leakage'] > 0:
@@ -222,9 +189,6 @@ check_info['kentix_amp_sensors.leakage'] = {
'inventory_function' : lambda i: inventory_kentix_amp_sensors(i,
None),
'check_function' : check_kentix_amp_sensors_leakage,
'service_description' : 'Leakage %s',
- 'has_perfdata' : True,
- 'snmp_info' : info_kentix_amp_sensors,
- 'snmp_scan_function' : scan_kentix_amp_sensors,
}
#.