Module: check_mk
Branch: master
Commit: d255ee0bcdffc17283d02854dcc011004b16b9b4
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=d255ee0bcdffc1…
Author: Bastian Kuhn <bk(a)mathias-kettner.de>
Date: Wed May 13 09:56:59 2015 +0200
esx_vsphere_hostsystem: Minor cleanup
---
checks/esx_vsphere_hostsystem | 18 ++++--------------
1 file changed, 4 insertions(+), 14 deletions(-)
diff --git a/checks/esx_vsphere_hostsystem b/checks/esx_vsphere_hostsystem
index 691ec914..9cb7ac3 100644
--- a/checks/esx_vsphere_hostsystem
+++ b/checks/esx_vsphere_hostsystem
@@ -292,30 +292,20 @@ def inventory_esx_vsphere_hostsystem_state(info):
def check_esx_vsphere_hostsystem_state(_no_item, _no_params, info):
data = esx_vsphere_hostsystem_convert(info)
state = 0
- label = {}
- messages = []
- label['Status'] = ""
overallStatus = str(data['overallStatus'][0])
if overallStatus == "yellow":
state = 1
- label['Status'] = "(!)"
elif overallStatus in [ "red", "gray"]:
state = 2
- label['Status'] = "(!!)"
- messages.append("Entity state: %s%s" % (overallStatus,
label['Status']))
+ yield state, "Entity state: %s" + overallStatus
- label['powerState'] = ''
+ state = 0
powerState = str(data['runtime.powerState'][0])
if powerState in ['poweredOff', 'unknown']:
state = 2
- label['powerState'] = "(!!)"
elif powerState == 'standBy':
- state = max(state, 1)
- label['powerState'] = "(!)"
- messages.append("Power state: %s%s" % (powerState,
label['powerState']))
-
-
- return(state, ", ".join(messages))
+ state = 1
+ yield state, "Power state: " + powerState
check_info['esx_vsphere_hostsystem.state'] = {
"inventory_function" : inventory_esx_vsphere_hostsystem_state,