Module: check_mk
Branch: master
Commit: 40617f2bf72b7fac8b596d5112bedeea61138df1
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=40617f2bf72b7f…
Author: Simon Betz <si(a)mathias-kettner.de>
Date: Wed Feb 22 14:28:25 2017 +0100
removed pprint
Change-Id: I78573a6fd0b6b95ef714ab3de05fe9503549f8fe
---
checks/blade_bays | 15 +++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)
diff --git a/checks/blade_bays b/checks/blade_bays
index e41e786..76f4398 100644
--- a/checks/blade_bays
+++ b/checks/blade_bays
@@ -53,20 +53,19 @@ def parse_blade_bays(info):
power = 0
parsed.setdefault(itemname, {
- "_type_" : ty.split("(")[0],
- "_id_" : identifier,
- "_power_max_" : power_max,
+ "type" : ty.split("(")[0],
+ "id" : identifier,
+ "power_max" : power_max,
"device_state" : map_states.get(state, (3,
"unhandled[%s]" % state)),
"power" : power,
})
- pprint.pprint(parsed)
return parsed
def inventory_blade_bays(parsed):
for entry, attrs in parsed.items():
- if attrs["_device_state_"][1] in [ "standby", "on"
]:
+ if attrs["device_state"][1] in [ "standby", "on"
]:
yield entry, {}
@@ -75,12 +74,16 @@ def check_blade_bays(item, params, parsed):
yield 3, "No data for '%s' in SNMP info" % item
return
+ data = parsed[item]
+ state, state_readable = data["device_state"]
+ yield state, "Status: %s" % state_readable
+
for res in check_elphase(item, params, parsed):
yield res
data = parsed[item]
yield 0, "Max. power: %s W, Type: %s, ID: %s" % \
- (data["_power_max_"], data["_type_"],
data["_id_"])
+ (data["power_max"], data["type"], data["id"])
check_info["blade_bays"] = {