Module: check_mk
Branch: master
Commit: b3232c423bd08f3395368583ee14c56832095787
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=b3232c423bd08f…
Author: Konstantin Büttner <kb(a)mathias-kettner.de>
Date: Wed Jul 1 12:15:09 2015 +0200
wut_webtherm: Moved default params to factory_settings dict
---
checks/wut_webtherm | 33 +++++++++++++++++++--------------
1 file changed, 19 insertions(+), 14 deletions(-)
diff --git a/checks/wut_webtherm b/checks/wut_webtherm
index e45231a..262087c 100644
--- a/checks/wut_webtherm
+++ b/checks/wut_webtherm
@@ -24,9 +24,24 @@
# to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
# Boston, MA 02110-1301 USA.
-wut_webtherm_defaultlevels = (30, 35)
+def detect_webtherm(oid):
+ return oid(".1.3.6.1.2.1.1.2.0") in \
+ [ ".1.3.6.1.4.1.5040.1.2.1",
+ ".1.3.6.1.4.1.5040.1.2.2",
+ ".1.3.6.1.4.1.5040.1.2.3",
+ ".1.3.6.1.4.1.5040.1.2.6",
+ ".1.3.6.1.4.1.5040.1.2.7",
+ ".1.3.6.1.4.1.5040.1.2.8",
+ ".1.3.6.1.4.1.5040.1.2.9",
+ ".1.3.6.1.4.1.5040.1.2.16",
+ ".1.3.6.1.4.1.5040.1.2.18" ]
+
+factory_settings["wut_webtherm_defaultlevels"] = {
+ "levels" : (30, 35),
+}
def inventory_webtherm(info):
+ print 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.
for line in info:
@@ -36,7 +51,7 @@ def inventory_webtherm(info):
# Maybe humidity
if temp > 75:
continue
- yield (line[0].split(".")[1],
"wut_webtherm_defaultlevels")
+ yield line[0].split(".")[1], {}
def check_webtherm(item, params, info):
for line in info:
@@ -44,21 +59,11 @@ def check_webtherm(item, params, info):
temp = float(line[1].replace(",", "."))
return check_temperature(temp, params)
-def detect_webtherm(oid):
- return oid(".1.3.6.1.2.1.1.2.0") in \
- [ ".1.3.6.1.4.1.5040.1.2.1",
- ".1.3.6.1.4.1.5040.1.2.2",
- ".1.3.6.1.4.1.5040.1.2.3",
- ".1.3.6.1.4.1.5040.1.2.6",
- ".1.3.6.1.4.1.5040.1.2.7",
- ".1.3.6.1.4.1.5040.1.2.8",
- ".1.3.6.1.4.1.5040.1.2.9",
- ".1.3.6.1.4.1.5040.1.2.16",
- ".1.3.6.1.4.1.5040.1.2.18" ]
check_info["wut_webtherm"] = {
- 'check_function' : check_webtherm,
+ 'default_levels_variable' : "wut_webtherm_defaultlevels",
'inventory_function' : inventory_webtherm,
+ 'check_function' : check_webtherm,
'service_description' : 'Temperature %s',
'has_perfdata' : True,
'snmp_info' : ('.1.3.6.1.4.1.5040.1.2',