Module: check_mk
Branch: master
Commit: 7e45d27fbe59317db489f77c2eabbace2ce23cf5
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=7e45d27fbe5931…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Tue Dec 16 16:19:35 2014 +0100
#1666 FIX inventory check esx_vsphere_hostsystem: no longer crashes if information is
missing
In certain scenarios (which still need to be investigated) the hostsystem does
not report any information for the node "hardware.cpuPkg", which caused an
exception in the
inventory check esx_vsphere_hostsystem.
---
.werks/1666 | 12 ++++++++++++
ChangeLog | 1 +
inventory/esx_vpshere_hostsystem | 7 ++++---
3 files changed, 17 insertions(+), 3 deletions(-)
diff --git a/.werks/1666 b/.werks/1666
new file mode 100644
index 0000000..b3dc639
--- /dev/null
+++ b/.werks/1666
@@ -0,0 +1,12 @@
+Title: inventory check esx_vsphere_hostsystem: no longer crashes if information is
missing
+Level: 1
+Component: checks
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.2.7i1
+Date: 1418742995
+
+In certain scenarios (which still need to be investigated) the hostsystem does
+not report any information for the node "hardware.cpuPkg", which caused an
exception in the
+inventory check esx_vsphere_hostsystem.
diff --git a/ChangeLog b/ChangeLog
index 112a8e1..ec49e3a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -15,6 +15,7 @@
* 1764 FIX: mk_sap: Fixed exception when saving status file
* 1663 FIX: winperf_if: fixed incorrect enumeration of interface index...
* 1204 FIX: veeam_client: Not longer throwing an error in case of currenlty running
backup
+ * 1666 FIX: inventory check esx_vsphere_hostsystem: no longer crashes if information
is missing...
Multisite:
* 1758 Improved exception hander: Shows details without additional debug request,
added mailto link for error report...
diff --git a/inventory/esx_vpshere_hostsystem b/inventory/esx_vpshere_hostsystem
index 29201d0..9658164 100644
--- a/inventory/esx_vpshere_hostsystem
+++ b/inventory/esx_vpshere_hostsystem
@@ -78,9 +78,10 @@ def inv_esx_vsphere_hostsystem(info):
node["cores_per_cpu"] = node["cores"] / node["cpus"]
node["threads"] =
int(data["hardware.cpuInfo"]["numCpuThreads"])
node["threads_per_cpu"] = node["threads"] /
node["cpus"]
- node["model"] =
data["hardware.cpuPkg"]["0"]["description"]
- node["vendor"] =
data["hardware.cpuPkg"]["0"]["vendor"]
- node["bus_speed"] =
float(data["hardware.cpuPkg"]["0"]["busHz"])
+ if "hardware.cpuPkg" in data:
+ node["model"] =
data["hardware.cpuPkg"]["0"]["description"]
+ node["vendor"] =
data["hardware.cpuPkg"]["0"]["vendor"]
+ node["bus_speed"] =
float(data["hardware.cpuPkg"]["0"]["busHz"])
node = inv_tree("hardware.bios.")
node["version"] =
data["hardware.biosInfo"]["biosVersion"]