From 09107b7e1b39e5097ec33b89924b21b5d785f847 Mon Sep 17 00:00:00 2001 From: Christian Bergum Bergersen Date: Sun, 1 Mar 2015 04:04:06 +0100 Subject: [PATCH] Added no_verification=True to avoid SSL verification Pywbem 0.7.0 and higher verifies SSL certificates by default, which creates problems for the script when Pywbem is updated. no_verification=True argument is hard-coded. --- check_esxi_hardware.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/check_esxi_hardware.py b/check_esxi_hardware.py index 3a61754..ca0a81c 100755 --- a/check_esxi_hardware.py +++ b/check_esxi_hardware.py @@ -36,6 +36,7 @@ # Copyright (c) 2012 Craig Hart # Copyright (c) 2013 Carl R. Friend # Copyright (c) 2015 Andreas Gottwald +# Copyright (c) 2015 Christian Bergum Bergersen # # The VMware 4.1 CIM API is documented here: # http://www.vmware.com/support/developer/cim-sdk/4.1/smash/cim_smash_410_prog.pdf @@ -216,6 +217,10 @@ #@ Author : Andreas Gottwald #@ Reason : Fix NoneType element bug #@--------------------------------------------------- +#@ Date : 20150301 +#@ Author : Christian Bergum Bergersen +#@ Reason : Ignores SSL verification of WBEM connection. Required to turn on/off in pywbem 0.7.0 and higher. +#@--------------------------------------------------- import sys import time @@ -570,7 +575,7 @@ if os_platform != "win32": # connection to host verboseoutput("Connection to "+hosturl) -wbemclient = pywbem.WBEMConnection(hosturl, (user,password), NS) +wbemclient = pywbem.WBEMConnection(hosturl, (user,password), NS, no_verification=True) # Add a timeout for the script. When using with Nagios, the Nagios timeout cannot be < than plugin timeout. if on_windows == False and timeout > 0: