Module: check_mk
Branch: master
Commit: c36fc186375c86dea347475aceeb212e4b39553a
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=c36fc186375c86…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Wed Mar 16 13:51:53 2016 +0100
3009 FIX ESX agent: fixed exception with utf-8 encoded strings
The agent tried to encode and already utf-8 encoded string.
---
.werks/3009 | 10 ++++++++++
ChangeLog | 1 +
agents/special/agent_vsphere | 9 ++++++++-
3 files changed, 19 insertions(+), 1 deletion(-)
diff --git a/.werks/3009 b/.werks/3009
new file mode 100644
index 0000000..8b7a235
--- /dev/null
+++ b/.werks/3009
@@ -0,0 +1,10 @@
+Title: ESX agent: fixed exception with utf-8 encoded strings
+Level: 1
+Component: checks
+Compatible: compat
+Version: 1.2.9i1
+Date: 1458132586
+Class: fix
+
+The agent tried to encode and already utf-8 encoded string.
+
diff --git a/ChangeLog b/ChangeLog
index eec0fae..317f7b0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -83,6 +83,7 @@
* 3007 FIX: Interface groups: fixed exception when port type or interface items were
not set in the WATO rule...
* 3098 FIX: isc_dhcpd: fixed handling of leases that never expire
* 3099 FIX: mk_mysql: worked around problems where running instances can't be
discovered
+ * 3009 FIX: ESX agent: fixed exception with utf-8 encoded strings...
Multisite:
* 3187 notification view: new filter for log command via regex
diff --git a/agents/special/agent_vsphere b/agents/special/agent_vsphere
index 64d34cc6..85da7df 100755
--- a/agents/special/agent_vsphere
+++ b/agents/special/agent_vsphere
@@ -1675,7 +1675,14 @@ if not error:
raise
error = "Error while processing received data"
-print "\n".join(vsphere_output)
+
+def make_utf8(line):
+ if type(line) == unicode:
+ return line.encode("utf-8")
+ else:
+ return line
+
+print "\n".join(map(make_utf8, vsphere_output))
if opt_agent:
sys.stdout.write(get_agent_info_tcp(host_address))