From 89f9e505c398b382c5af0ba739efe9e6e5ea5cf7 Mon Sep 17 00:00:00 2001 From: Claudio Kuenzler Date: Thu, 13 Oct 2016 15:59:19 +0200 Subject: [PATCH] Added support for pywbem 0.9.x (and upcoming releases) --- check_esxi_hardware.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/check_esxi_hardware.py b/check_esxi_hardware.py index c831623..cf70e83 100755 --- a/check_esxi_hardware.py +++ b/check_esxi_hardware.py @@ -239,6 +239,10 @@ #@ Author : Claudio Kuenzler (www.claudiokuenzler.com) #@ Reason : Add parameter for variable CIM port (useful when behind NAT) #@--------------------------------------------------- +#@ Date : 20161013 +#@ Author : Claudio Kuenzler (www.claudiokuenzler.com) +#@ Reason : Added support for pywbem 0.9.x (and upcoming releases) +#@--------------------------------------------------- import sys import time @@ -247,7 +251,7 @@ import re import pkg_resources from optparse import OptionParser,OptionGroup -version = '20160531' +version = '20161013' NS = 'root/cimv2' hosturl = '' @@ -615,7 +619,7 @@ if '0.7.' in pywbemversion: verboseoutput("Connection worked") wbemclient = pywbem.WBEMConnection(hosturl, (user,password)) # pywbem 0.8.0 and later -elif '0.8.' in pywbemversion: +else: 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.