Module: check_mk
Branch: master
Commit: 899dee8f78a64fcd119cbf00c5c6895d3351809c
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=899dee8f78a64f…
Author: Simon Betz <si(a)mathias-kettner.de>
Date: Wed Jan 11 15:28:59 2017 +0100
minor cleanup
Change-Id: Ic7992bcc89de5d10903f87632b40c8d3cabf63d2
---
checks/ups_eaton_enviroment | 20 +++++++++++++++-----
1 file changed, 15 insertions(+), 5 deletions(-)
diff --git a/checks/ups_eaton_enviroment b/checks/ups_eaton_enviroment
index c090e6c..4118553 100644
--- a/checks/ups_eaton_enviroment
+++ b/checks/ups_eaton_enviroment
@@ -26,9 +26,9 @@
factory_settings["ups_eaton_enviroment_default"] = {
- "temp" : (40, 50),
+ "temp" : (40, 50),
"remote_temp" : (40, 50),
- "humidity" : (65, 80),
+ "humidity" : (65, 80),
}
@@ -43,19 +43,26 @@ def check_ups_eaton_enviroment(item, params, info):
state = 0
messages = []
perfdata = []
- for sensor, sensor_name, unit in [("temp", "Temperature",
u"°C"), ("remote_temp", "Remote-Temperature",
u"°C"), ("humidity", "Humidity", "%")]:
+ for sensor, sensor_name, unit in [
+ ("temp", "Temperature", u"°C"),
+ ("remote_temp", "Remote-Temperature", u"°C"),
+ ("humidity", "Humidity", "%")]:
+
warn, crit = params.get(sensor)
perfdata.append((sensor, wert[i], warn, crit))
text = "%s: %d%s (warn/crit at %d%s/%d%s)" % \
- (sensor_name, wert[i],unit, warn, unit, crit, unit)
+ (sensor_name, wert[i],unit, warn, unit, crit, unit)
+
if wert[i] >= crit:
state = 2
text += "(!!)"
elif wert[i] >= warn:
state = max(state, 1)
text += "(!)"
+
i += 1
messages.append(text)
+
return (state, ", ".join(messages), perfdata)
@@ -67,5 +74,8 @@ check_info['ups_eaton_enviroment'] = {
"has_perfdata" : True,
"group" : "eaton_enviroment",
"snmp_info" : ( ".1.3.6.1.4.1.534.1.6", [1,5,6 ] ),
- "snmp_scan_function" : lambda oid: oid(".1.3.6.1.2.1.1.2.0")
in [".1.3.6.1.4.1.705.1.2", ".1.3.6.1.4.1.534.1",
".1.3.6.1.4.1.705.1"],
+ "snmp_scan_function" : lambda oid: oid(".1.3.6.1.2.1.1.2.0")
in \
+ [".1.3.6.1.4.1.705.1.2",
+ ".1.3.6.1.4.1.534.1",
+ ".1.3.6.1.4.1.705.1"],
}