Module: check_mk
Branch: master
Commit: f675f94774357e1c70415f2b20ee2048cad103b8
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=f675f94774357e…
Author: Bastian Kuhn <bk(a)mathias-kettner.de>
Date: Thu Dec 12 18:18:12 2013 +0100
Changes on stulz_powerstate
---
checks/stulz_powerstate | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/checks/stulz_powerstate b/checks/stulz_powerstate
index 0803ef8..9f1ad85 100644
--- a/checks/stulz_powerstate
+++ b/checks/stulz_powerstate
@@ -30,18 +30,21 @@ def inventory_stulz_powerstate(info):
def check_stulz_powerstate(item, _no_params, info):
for line in info:
if line[0] == item:
- if line[1] != '0':
+ if line[1] != '1':
message = "Device powered off"
+ power_state = 2
else:
message = "Device powered on"
- return 0, message
+ power_state = 6
+
+ return 0, message, [ ('state', power_state ) ]
return 3, "No information found about the device"
check_info["stulz_powerstate"] = {
"check_function" : check_stulz_powerstate,
"inventory_function" : inventory_stulz_powerstate,
"service_description" : "State %s ",
- "has_perfdata" : False,
+ "has_perfdata" : True,
"snmp_scan_function" : lambda oid: oid(".1.3.6.1.2.1.1.2.0")
== ".1.3.6.1.4.1.29462.10",
"snmp_info" : (
".1.3.6.1.4.1.29462.10.2.1.4.1.1.1.1013", [ OID_END, 1] ),
}