Module: check_mk
Branch: master
Commit: e67506671ae3c19978531841a9c93f6880413783
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=e67506671ae3c1…
Author: Simon Betz <si(a)mathias-kettner.de>
Date: Mon Dec 12 15:02:55 2016 +0100
4162 FIX esx_vsphere_vm.heartbeat: fixed KeyError
Change-Id: I92f37f7f285f86bb9fa84c0125b4c6991e537511
---
.werks/4162 | 10 ++++++++++
ChangeLog | 1 +
checks/esx_vsphere_vm | 3 +++
3 files changed, 14 insertions(+)
diff --git a/.werks/4162 b/.werks/4162
new file mode 100644
index 0000000..0854c6e
--- /dev/null
+++ b/.werks/4162
@@ -0,0 +1,10 @@
+Title: esx_vsphere_vm.heartbeat: fixed KeyError
+Level: 1
+Component: checks
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.4.0i3
+Date: 1481551341
+
+
diff --git a/ChangeLog b/ChangeLog
index 70728f6..f6df498 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -62,6 +62,7 @@
* 4102 FIX: logwatch: Fixed crash due to non-existant logfile...
* 4160 FIX: emcvnx_info: fixed data handling, now detects errors
* 4161 FIX: emcvnx_sp_util: fixed empty data handling
+ * 4162 FIX: esx_vsphere_vm.heartbeat: fixed KeyError
Multisite:
* 4070 Added a painter for the service check period
diff --git a/checks/esx_vsphere_vm b/checks/esx_vsphere_vm
index 643827a..1063ba2 100644
--- a/checks/esx_vsphere_vm
+++ b/checks/esx_vsphere_vm
@@ -288,6 +288,9 @@ def inventory_esx_vsphere_vm_hb_status(info):
def check_esx_vsphere_vm_hb_status(_no_item, params, info):
data = esx_vsphere_vm_convert(info)
+ if data.get('guestHeartbeatStatus') is None:
+ return
+
vm_status = data['guestHeartbeatStatus'][0]
state = 3