1
0
mirror of https://github.com/Napsty/check_esxi_hardware.git synced 2024-11-24 03:13:50 +01:00

Added support for pywbem 0.9.x (and upcoming releases)

This commit is contained in:
Claudio Kuenzler 2016-10-13 15:59:19 +02:00
parent 82a4156e34
commit 89f9e505c3

View File

@ -239,6 +239,10 @@
#@ Author : Claudio Kuenzler (www.claudiokuenzler.com) #@ Author : Claudio Kuenzler (www.claudiokuenzler.com)
#@ Reason : Add parameter for variable CIM port (useful when behind NAT) #@ 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 sys
import time import time
@ -247,7 +251,7 @@ import re
import pkg_resources import pkg_resources
from optparse import OptionParser,OptionGroup from optparse import OptionParser,OptionGroup
version = '20160531' version = '20161013'
NS = 'root/cimv2' NS = 'root/cimv2'
hosturl = '' hosturl = ''
@ -615,7 +619,7 @@ if '0.7.' in pywbemversion:
verboseoutput("Connection worked") verboseoutput("Connection worked")
wbemclient = pywbem.WBEMConnection(hosturl, (user,password)) wbemclient = pywbem.WBEMConnection(hosturl, (user,password))
# pywbem 0.8.0 and later # pywbem 0.8.0 and later
elif '0.8.' in pywbemversion: else:
wbemclient = pywbem.WBEMConnection(hosturl, (user,password), NS, no_verification=True) 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. # Add a timeout for the script. When using with Nagios, the Nagios timeout cannot be < than plugin timeout.