Module: check_mk
Branch: master
Commit: 355b0f49e1d67a37eeac9f8dc2dd1b83b44d2b2c
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=355b0f49e1d67a…
Author: Simon Betz <si(a)mathias-kettner.de>
Date: Fri Oct 19 11:37:19 2018 +0200
6808 FIX agent_vsphere: Fixed retrieving system information
Change-Id: Ia8442cd24e06f669c608d88963eeaf9346394e18
---
.werks/6808 | 11 +++++++++++
agents/special/agent_vsphere | 26 +++++++++++++-------------
2 files changed, 24 insertions(+), 13 deletions(-)
diff --git a/.werks/6808 b/.werks/6808
new file mode 100644
index 0000000..29987ba
--- /dev/null
+++ b/.werks/6808
@@ -0,0 +1,11 @@
+Title: agent_vsphere: Fixed retrieving system information
+Level: 1
+Component: checks
+Class: fix
+Compatible: compat
+Edition: cre
+State: unknown
+Version: 1.6.0i1
+Date: 1539938611
+
+
diff --git a/agents/special/agent_vsphere b/agents/special/agent_vsphere
index cf635fe..a494139 100755
--- a/agents/special/agent_vsphere
+++ b/agents/special/agent_vsphere
@@ -1003,17 +1003,17 @@ def get_agent_info_tcp(hostname):
# Globals of ESX System. These settings are available after the first
"systeminfo" query
systemfields = [
- ("apiVersion", float),
- ("name", None),
- ("rootFolder", None),
- ("perfManager", None),
- ("sessionManager", None),
- ("licenseManager", None),
- ("propertyCollector", None),
- ("version", None),
- ("build", None),
- ("vendor", None),
- ("osType", None),
+ "apiVersion",
+ "name",
+ "rootFolder",
+ "perfManager",
+ "sessionManager",
+ "licenseManager",
+ "propertyCollector",
+ "version",
+ "build",
+ "vendor",
+ "osType",
]
systeminfo = {}
@@ -1172,10 +1172,10 @@ def retrieve_systeminfo():
# Retrieve basic data, which requires no login
payload = telegram_list["systeminfo"]
_reply_code, _reply_msg, _reply_headers, reply_data = query_server(payload)
- for entry, function in systemfields:
+ for entry in systemfields:
element = get_pattern("<%(entry)s.*>(.*)</%(entry)s>" % {
"entry": entry }, reply_data)
if element:
- systeminfo[entry] = function(element[0]) if function else element[0]
+ systeminfo[entry] = element[0]
def login():