Skip to content

Commit

Permalink
Added support for pywbem 0.9.x (and upcoming releases)
Browse files Browse the repository at this point in the history
  • Loading branch information
Napsty committed Oct 13, 2016
1 parent 82a4156 commit 89f9e50
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions check_esxi_hardware.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -247,7 +251,7 @@
import pkg_resources
from optparse import OptionParser,OptionGroup

version = '20160531'
version = '20161013'

NS = 'root/cimv2'
hosturl = ''
Expand Down Expand Up @@ -615,7 +619,7 @@ def handler(signum, frame):
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.
Expand Down

0 comments on commit 89f9e50

Please sign in to comment.