Module: check_mk
Branch: master
Commit: 34bd33aae8f94c302e244bf11286dcf1ec9eb11a
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=34bd33aae8f94c…
Author: Simon Betz <si(a)mathias-kettner.de>
Date: Mon Nov 7 10:22:30 2016 +0100
update to werk 3913
---
checks/gude_humidity | 14 ++++++++++----
checks/gude_temp | 14 ++++++++++----
2 files changed, 20 insertions(+), 8 deletions(-)
diff --git a/checks/gude_humidity b/checks/gude_humidity
index 18bb690..19bb102 100644
--- a/checks/gude_humidity
+++ b/checks/gude_humidity
@@ -34,12 +34,17 @@ gude_humidity_default_levels = (0, 0, 60, 70)
def inventory_gude_humidity(info):
- if info[0][0].split(".")[-1] != "-9999":
- return [ ("Sensor", "gude_humidity_default_levels") ]
+ for oid_index, reading_str in info:
+ oid, index = oid_index.split(".")
+ if reading_str != "-9999":
+ yield "Sensor %s" % index,
"gude_humidity_default_levels"
def check_gude_humidity(item, params, info):
- return check_humidity(float(info[0][0].split(".")[-1])/10, params)
+ for oid_index, reading_str in info:
+ oid, index = oid_index.split(".")
+ if "Sensor %s" % index == item:
+ return check_humidity(float(reading_str)/10, params)
check_info['gude_humidity'] = {
@@ -48,7 +53,8 @@ check_info['gude_humidity'] = {
'service_description' : 'Humidity %s',
'has_perfdata' : True,
'snmp_info' : ('.1.3.6.1.4.1.28507', [ "19",
"38" ], [
- "1.6.1.1.3.1", #
GUDEADS-EPC****-MIB::epc****HygroSensor
+ OID_END,
+ "1.6.1.1.3", #
GUDEADS-EPC****-MIB::epc****HygroSensor
]),
'snmp_scan_function' : lambda oid:
oid(".1.3.6.1.2.1.1.2.0").startswith(".1.3.6.1.4.1.28507.19") or \
oid(".1.3.6.1.2.1.1.2.0").startswith(".1.3.6.1.4.1.28507.38"),
diff --git a/checks/gude_temp b/checks/gude_temp
index 951538a..9a9bfd7 100644
--- a/checks/gude_temp
+++ b/checks/gude_temp
@@ -36,12 +36,17 @@ factory_settings["gude_temp_default_levels"] = {
def inventory_gude_temp(info):
- if info[0][0].split(".")[-1] != "-9999":
- return [ ("Sensor", {}) ]
+ for oid_index, reading_str in info:
+ oid, index = oid_index.split(".")
+ if reading_str != "-9999":
+ yield "Sensor %s" % index, {}
def check_gude_temp(item, params, info):
- return check_temperature(float(info[0][0].split(".")[-1])/10, params,
"gude_temp.%s" % item)
+ for oid_index, reading_str in info:
+ oid, index = oid_index.split(".")
+ if "Sensor %s" % index == item:
+ return check_temperature(float(reading_str)/10, params,
"gude_temp.%s" % item)
check_info['gude_temp'] = {
@@ -50,7 +55,8 @@ check_info['gude_temp'] = {
'service_description' : 'Temperature %s',
'has_perfdata' : True,
'snmp_info' : ('.1.3.6.1.4.1.28507', [ "19",
"38" ], [
- "1.6.1.1.2.1", #
GUDEADS-EPC****-MIB::epc****TempSensor
+ OID_END,
+ "1.6.1.1.2", #
GUDEADS-EPC****-MIB::epc****TempSensor
]),
'snmp_scan_function' : lambda oid:
oid(".1.3.6.1.2.1.1.2.0").startswith(".1.3.6.1.4.1.28507.19") or \
oid(".1.3.6.1.2.1.1.2.0").startswith(".1.3.6.1.4.1.28507.38"),