Module: check_mk
Branch: master
Commit: 6a3118560c76e684050d7afc2621e8ff103d3389
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=6a3118560c76e6…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Wed Apr 6 11:04:47 2016 +0200
3322 esx_vsphere_hostsystem: inventory now adds information about memory, uuid and service
tag
Thanks to Markus Weber.
---
.werks/3322 | 9 +++++++++
ChangeLog | 1 +
inventory/esx_vsphere_hostsystem | 13 +++++++++++--
3 files changed, 21 insertions(+), 2 deletions(-)
diff --git a/.werks/3322 b/.werks/3322
new file mode 100644
index 0000000..05e0e2b
--- /dev/null
+++ b/.werks/3322
@@ -0,0 +1,9 @@
+Title: esx_vsphere_hostsystem: inventory now adds information about memory, uuid and
service tag
+Level: 1
+Component: inv
+Compatible: compat
+Version: 1.2.9i1
+Date: 1459933454
+Class: feature
+
+Thanks to Markus Weber.
diff --git a/ChangeLog b/ChangeLog
index c037d03..811e81c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -252,6 +252,7 @@
HW/SW-Inventory:
* 3192 snmp_extended_info: now inventorizes all physical components of devices which
support the ENTITY-MIB
* 3319 HW/SW-Inventory service can now be OK in case of unreachable host...
+ * 3322 esx_vsphere_hostsystem: inventory now adds information about memory, uuid and
service tag...
* 3219 FIX: lnx_distro: Now detecting Oracle VM Server correctly
* 3229 FIX: lnx_distro: SLES based systems have now an OS name inventorized\
* 3265 FIX: mk_inventory.solaris: fix problem on Solaris 10, do prtdiag and prtpicl
only in global zone
diff --git a/inventory/esx_vsphere_hostsystem b/inventory/esx_vsphere_hostsystem
index f357675..c22098b 100644
--- a/inventory/esx_vsphere_hostsystem
+++ b/inventory/esx_vsphere_hostsystem
@@ -61,7 +61,8 @@ def inv_esx_vsphere_hostsystem(info):
"hardware.cpuPkg": { "index": True},
"hardware.cpuInfo": { "index": False},
"hardware.biosInfo": { "index": False},
- "hardware.systemInfo": { "index": False}
+ "hardware.systemInfo": { "index": False},
+ "hardware.memorySize": { "index": False}
}
data = inv_esx_vsphere_hostsystem_parse(info, inv_items)
@@ -89,7 +90,6 @@ def inv_esx_vsphere_hostsystem(info):
node = inv_tree("hardware.bios.")
node["version"] =
data["hardware.biosInfo"]["biosVersion"]
- import time
try:
node["date"] = float(time.strftime("%s", \
time.strptime(data["hardware.biosInfo"]["releaseDate"],"%Y-%m-%dT%H:%M:%SZ")))
@@ -104,6 +104,15 @@ def inv_esx_vsphere_hostsystem(info):
if node["vendor"] == "HP":
node["serial"] =
data["hardware.systemInfo.otherIdentifyingInfo.ServiceTag"]["0"]
+ if "uuid" in data["hardware.systemInfo"]:
+ node["uuid"] =
data["hardware.systemInfo"]["uuid"]
+ if "0" in data["hardware.systemInfo"]:
+ node["serial"] =
data["hardware.systemInfo"]["0"]["ServiceTag"]
+ if "memorySize" in data["hardware"]:
+ node = inv_tree("hardware.memory.")
+ node["total_ram_usable"] =
int(data["hardware"]["memorySize"])
+
+
inv_info['esx_vsphere_hostsystem'] = {
"inv_function" : inv_esx_vsphere_hostsystem,
}