Module: check_mk
Branch: master
Commit: dee1c8260eab043c9ec827cafdf5db3850f343a9
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=dee1c8260eab04…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Tue Apr 16 15:39:22 2013 +0200
esx_vsphere_vm: warn if vmware tools are not installed
---
checks/esx_vsphere_vm | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/checks/esx_vsphere_vm b/checks/esx_vsphere_vm
index 998db95..32ed6ad 100644
--- a/checks/esx_vsphere_vm
+++ b/checks/esx_vsphere_vm
@@ -126,8 +126,7 @@ check_info['esx_vsphere_vm.name'] = {
#
def inventory_esx_vsphere_vm_hb_status(info):
data = esx_vsphere_vm_convert(info)
- status = data.get('guestHeartbeatStatus')
- if status and status[0] != "gray":
+ if 'guestHeartbeatStatus' in data:
return [(None, None)]
def check_esx_vsphere_vm_hb_status(item, params, info):
@@ -135,15 +134,15 @@ def check_esx_vsphere_vm_hb_status(item, params, info):
vm_status = data['guestHeartbeatStatus'][0]
state = 3
- if vm_status == 'gray':
- state = 3
+ if vm_status == 'gray':
+ return 1, "No VMWare Tools installed"
elif vm_status == 'green':
state = 0
elif vm_status == 'red':
state = 2
elif vm_status == 'yellow':
state = 1
- return(state, "Heartbeat status is %s" % vm_status)
+ return state, "Heartbeat status is %s" % vm_status
check_info['esx_vsphere_vm.heartbeat'] = {