Module: check_mk
Branch: master
Commit: e9777f2c1a5ec3571fe5c50005b53d82547eb74d
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=e9777f2c1a5ec3…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Mon Dec 8 11:27:25 2014 +0100
#1658 FIX agent_vsphere: no longer crashes when decommissioned vms report no hardware
information
When a virtual machine gets decommissioned its hardware information
(<tt>config.hardware.device</tt>) is
no longer reported. This caused the agent_vsphere to crash, unless all configuration files
of this virtual
machine were removed.
---
.werks/1658 | 12 ++++++++++++
ChangeLog | 2 ++
agents/special/agent_vsphere | 3 ++-
3 files changed, 16 insertions(+), 1 deletion(-)
diff --git a/.werks/1658 b/.werks/1658
new file mode 100644
index 0000000..00d79c5
--- /dev/null
+++ b/.werks/1658
@@ -0,0 +1,12 @@
+Title: agent_vsphere: no longer crashes when decommissioned vms report no hardware
information
+Level: 1
+Component: checks
+Compatible: compat
+Version: 1.2.5i7
+Date: 1418034002
+Class: fix
+
+When a virtual machine gets decommissioned its hardware information
(<tt>config.hardware.device</tt>) is
+no longer reported. This caused the agent_vsphere to crash, unless all configuration
files of this virtual
+machine were removed.
+
diff --git a/ChangeLog b/ChangeLog
index 48b7148..4bb9c37 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -10,6 +10,7 @@
* 1624 FIX: Remove illegal characters from service descriptions of active checks...
* 1628 FIX: Remove trailing backslashes from service descriptions...
* 1649 FIX: Check_MK inventory service has been renamed to Check_MK Discovery...
+ * 1657 FIX: check_mk_agent.solaris: run_cached: remove cache file if it is older than
twice the maximum cache age
* 1706 FIX: Fix file permissions when installing MKPs to 0644 or 0755...
Checks & Agents:
@@ -124,6 +125,7 @@
* 1454 FIX: megaraid checks: megacli binaries in lowercase (Ubuntu..) are now also
detected by the linux agent
* 1455 FIX: hp_proliant_mem: avoid a crash of the check when module_condition is
empty
* 1688 FIX: juniper_screenos_mem: Fixed wrong total memory computation
+ * 1658 FIX: agent_vsphere: no longer crashes when decommissioned vms report no
hardware information...
Multisite:
* 1508 Allow input of plugin output and perfdata when faking check results...
diff --git a/agents/special/agent_vsphere b/agents/special/agent_vsphere
index f57e41f..6a04ec7 100755
--- a/agents/special/agent_vsphere
+++ b/agents/special/agent_vsphere
@@ -934,7 +934,8 @@ if not error:
continue
else:
# we don't need this in the agent output
- del vm_data["config.hardware.device"]
+ if vm_data.get("config.hardware.device"):
+ del vm_data["config.hardware.device"]
if "runtime.host" in vm_data:
vm_data["runtime.host"] =
hostsystems.get(vm_data["runtime.host"], vm_data["runtime.host"])