Module: check_mk
Branch: master
Commit: 9c9eb9ebd6ed001f9a694fc114f61aa7754b4065
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=9c9eb9ebd6ed00…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Wed Aug 10 15:24:04 2016 +0200
3562 FIX agent_vsphere.pysphere: fixed problems related to ssl certificate validation on
older distributions/python versions
---
.werks/3562 | 10 ++++++++++
ChangeLog | 1 +
agents/special/agent_vsphere.pysphere | 7 +++++--
3 files changed, 16 insertions(+), 2 deletions(-)
diff --git a/.werks/3562 b/.werks/3562
new file mode 100644
index 0000000..420fad3
--- /dev/null
+++ b/.werks/3562
@@ -0,0 +1,10 @@
+Title: agent_vsphere.pysphere: fixed problems related to ssl certificate validation on
older distributions/python versions
+Level: 1
+Component: checks
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.4.0i1
+Date: 1470835398
+
+
diff --git a/ChangeLog b/ChangeLog
index e376a15..80dce87 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -329,6 +329,7 @@
* 3759 FIX: cpu.loads: Fixed possible crash on missing data
* 3715 FIX: agent_ipmi_sensors: fixed error handling
* 3772 FIX: ipmi_sensors: fixed missing states
+ * 3562 FIX: agent_vsphere.pysphere: fixed problems related to ssl certificate
validation on older distributions/python versions
Multisite:
* 3187 notification view: new filter for log command via regex
diff --git a/agents/special/agent_vsphere.pysphere
b/agents/special/agent_vsphere.pysphere
index 66c1e36..6389333 100755
--- a/agents/special/agent_vsphere.pysphere
+++ b/agents/special/agent_vsphere.pysphere
@@ -226,8 +226,11 @@ try:
sys.stderr.flush()
# Disable ssl certificate validation
- import ssl
- ssl._create_default_https_context = ssl._create_unverified_context
+ try: # quick fix
+ import ssl
+ ssl._create_default_https_context = ssl._create_unverified_context
+ except:
+ pass
host.connect(host_address+port, user, secret, sock_timeout=opt_timeout)
if opt_debug:
sys.stderr.write("Connected.\n")