Installing and testing the new pywbem 0.8 (development version)

Written by - 2 comments

Published on - Listed in Linux Nagios Monitoring VMware

The python module "pywbem" is the essential piece of the monitoring plugin check_esxi_hardware. It allows to gather information from the ESXi CIM server and therefore detect hardware failures.

In the last couple of years pywbem was patched directly by several distributions (Red Hat, SuSE, Ubuntu to name a few) - yet the upstream (original) development of pywbem was stuck in version 0.7.0.

A few months ago, the pywbem project on SourceForge was revived and a new release is just about the corner. Currently there are several development releases of the new version 0.8.0 available for download. You can manually install the new version with the following steps.

1. Download the newest zip file from

2. Make sure you have python installed, otherwise install python. Simply launch the "python" command to see if python is installed:

Python 2.7.8 (default, Sep 30 2014, 15:34:38) [GCC] on linux2
Type "help", "copyright", "credits" or "license" for more information.

3. Install the python module "M2Crypto". This is a new requirement for pywbem 0.8.0. The packet name is "python-M2Crypto" in openSUSE and "python-m2crypto" in Debian/Ubuntu.

zypper in python-M2Crypto

 4. As root user, unzip the pywbem zip file and launch the python setup script:

cd pywbem-0.8.0-dev

python install
running install_scripts
copying build/scripts-2.7/ -> /usr/bin
copying build/scripts-2.7/ -> /usr/bin
changing mode of /usr/bin/ to 755
changing mode of /usr/bin/ to 755
running install_egg_info
Writing /usr/lib/python2.7/site-packages/pywbem-0.8.0_dev-py2.7.egg-info

5. Test if pywbem can be imported as a python module:

Python 2.7.8 (default, Sep 30 2014, 15:34:38) [GCC] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import pywbem
>>> exit()

There was no error after the import command which means the installation worked.

Now I can test the CIM connection:

Python 2.7.8 (default, Sep 30 2014, 15:34:38) [GCC] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import pywbem
>>> wbemclient = pywbem.WBEMConnection('https://myesxi.internal', ('root', 'mypass'))
>>> c=wbemclient.EnumerateInstances('CIM_Card')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "pywbem/", line 1018, in EnumerateInstances
  File "pywbem/", line 592, in imethodcall
  File "pywbem/", line 542, in wbem_request
  File "/usr/lib64/python2.7/", line 991, in endheaders
  File "/usr/lib64/python2.7/", line 844, in _send_output
  File "pywbem/", line 333, in send
  File "pywbem/", line 419, in connect
    "SSL error %s: %s" % (str(arg.__class__), arg))
pywbem.cim_http.ConnectionError: SSL error <class 'M2Crypto.SSL.SSLError'>: certificate verify failed

Oops. Error. But that's expected. One of the patches added more security in the wbem connection by validating the returned certificate. This bug is already documented in the check_esxi_hardware FAQ. As a workaround, an additional parameter can be added to the pywbem.WBEMConnection function, but in the original 0.7.0 version this parameter does not exist and therefore breaks compatibility.

But now with the newer 0.8.0 version the version name can be read:

Python 2.7.8 (default, Sep 30 2014, 15:34:38) [GCC] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import pywbem
>>> import pkg_resources
>>> pkg_resources.get_distribution("pywbem").version
>>> exit()

Hence there is now a difference now between the original 0.7.0 and the newer 0.8.0 version which can be checked before applying the additional parameter into the pywbem.WBEMConnection function.

As soon as the 0.8.0 is officially out, I hope that Linux distributions will start to roll out the upstream version again and then you can expect a final bug fix in check_esxi_hardware, too.

Add a comment

Show form to leave a comment

Comments (newest first)

Claudio Kuenzler from Switzerland wrote on Apr 28th, 2016:

Now that pywbem 0.8.x is officially released, the easiest method (by far!) is to just use pip.

pip install pywbem

And you're all set.

Gordon Rogers from wrote on Apr 28th, 2016:

Thanks for your help, Installing pywbem & is difficult

Thanks to:

I now have the ESX script running again with Python 2.7.11 on Windows 7.

My steps:
Download pywbem-0.8.0 as per step 1
In windows you will now get an error when installing with:
C:\Python27\pywbem-0.8.0-dev> install

So you need to get M2Crypto installed.
Thanks to:
Grab the M2CryptoWin32 package and install with:
C:\Python27\M2CryptoWin32-0.21.1-3> install