New version of check_esxi_hardware fixes issue with patched pywbem

Written by - 8 comments

Published on - Listed in Nagios Monitoring Linux VMware


In the past few months I got more and more feedback concerning the following error when the Nagios plugin check_esxi_hardware was launched:

Unknown CIM Error: (0, 'SSL error: certificate verify failed')

As described in the FAQ of check_esxi_hardware, the problem often appeared after the system, on which the plugin runs, was updated. See also issue #7 on the github repo. But there is actually deeper history into that.

You're all aware that the core of check_esxi_hardware is the python module "pywbem". The upstream project appeared to be dead for a long time. When SSL security/vulnerability issues arose, some distributions manually fixed the code of pywbem which resulted in check_esxi_hardware failing because the syntax to connect to a CIM server has changed. Another problem was/still is, that the pywbem version never changed; it staid at 0.7.0 for several years, although there were many patches applied in several distros.

In September 2014 everything started to look better as it seemed, there was life in the pywbem project again. A new release of a version 0.8.0 seemed close. But once again there is no news anymore since the end of January 2015.

Nevertheless, the Nagios plugin check_esxi_hardware needed to be adapted for patched pywbems.
From today on version 20150626 fixes the compatibility issue and allows to be used with the "old" pywbem version as well as with patched pywbem 0.7.0 packages. And it is also ready for the new 0.8.0 release if that is ever to be shipped into distros.

The 20150626 version was successfully tested on the following Linux distros:

  • openSUSE 13.2 with python 2.7.8 and pywbem 0.8.0-dev.r728 (from upstream source)
  • Ubuntu 14.04 LTS (trusty) with python 2.7.6 and pywbem 0.7.0-4ubuntu1~14.04.1 (official Ubuntu repo)
  • Unbunt 12.04 LTS (precise) with python 2.7.3 and pywbem 0.7.0-4 (official Ubuntu repo)

Enjoy!

Update October 6th 2015: The pywbem project isn't dead. The mailing list is active again since yesterday October 5th and the source code will be moved to github soon.


Add a comment

Show form to leave a comment

Comments (newest first)

Adrian from Romania wrote on Nov 14th, 2016:

Hello,
I am getting the following error:
20161114 13:47:14 Found pywbem version 0.7.0
20161114 13:47:14 Connection error, disable SSL certification verification (probably patched pywbem)
20161114 13:47:14 Check classe OMC_SMASHFirmwareIdentity
Traceback (most recent call last):
File "./check_esxi_hardware_2.py", line 669, in
instance_list = wbemclient.EnumerateInstances(classe)
File "/usr/lib64/python2.6/site-packages/pywbem/cim_operations.py", line 421, in EnumerateInstances
**params)
File "/usr/lib64/python2.6/site-packages/pywbem/cim_operations.py", line 183, in imethodcall
no_verification = self.no_verification)
File "/usr/lib64/python2.6/site-packages/pywbem/cim_http.py", line 266, in wbem_request
h.endheaders()
File "/usr/lib64/python2.6/httplib.py", line 914, in endheaders
self._send_output()
File "/usr/lib64/python2.6/httplib.py", line 786, in _send_output
self.send(msg)
File "/usr/lib64/python2.6/site-packages/pywbem/cim_http.py", line 115, in send
self.connect()
File "/usr/lib64/python2.6/site-packages/pywbem/cim_http.py", line 163, in connect
if not check(self.sock.get_peer_cert(), self.host):
File "/usr/lib64/python2.6/site-packages/M2Crypto/SSL/Checker.py", line 98, in __call__
fieldName='subjectAltName')
M2Crypto.SSL.Checker.WrongHost: Peer certificate subjectAltName does not match host, expected ****.****.com, got DNS:localhost.localdomain

I have the version 20161013

zypper info python-setuptools
Loading repository data...
Reading installed packages...


Information for package python-setuptools:

Repository: sles11sp4sdk
Name: python-setuptools
Version: 0.6c11-5.2.1
Arch: x86_64
Vendor: SUSE LINUX Products GmbH, Nuernberg, Germany
Support Level: unknown
Installed: Yes

OS:
NAME="SLES"
VERSION="11.4"
VERSION_ID="11.4"
PRETTY_NAME="SUSE Linux Enterprise Server 11 SP4"

uname -r
3.0.101-63-default


ck from Zurich, Switzerland wrote on Nov 30th, 2015:

Hi Matthias, did you already try it with the newest version of pywbem 0.8.0?


Matthias Koch from wrote on Nov 17th, 2015:

OS = CentOS 7
pywbem = 0.7.0, Rel. 25.20130827svn625.el7


Matthias Koch from wrote on Nov 17th, 2015:

Same problem here. Here's my command:

# ./check_esxi_hardware.py -H [hostname]:8443 -U [myID] -P [myPasswd] -v -V hp

...and here's the output:

20151116 11:51:51 Connection to https://[hostname]:8443
20151116 11:51:51 Found pywbem version 0.7.0
20151116 11:51:51 Connection error, disable SSL certification verification (probably patched pywbem)
20151116 11:51:51 Check classe OMC_SMASHFirmwareIdentity
20151116 11:51:51 Unknown CIM Error: (0, 'HTTP error: Not Found')
20151116 11:51:51 Check classe CIM_Chassis
20151116 11:51:51 Unknown CIM Error: (0, 'HTTP error: Not Found')
20151116 11:51:51 Check classe CIM_Card
20151116 11:51:51 Unknown CIM Error: (0, 'HTTP error: Not Found')
20151116 11:51:51 Check classe CIM_ComputerSystem
20151116 11:51:51 Unknown CIM Error: (0, 'HTTP error: Not Found')
20151116 11:51:51 Check classe CIM_NumericSensor
20151116 11:51:51 Unknown CIM Error: (0, 'HTTP error: Not Found')
20151116 11:51:51 Check classe CIM_Memory
20151116 11:51:51 Unknown CIM Error: (0, 'HTTP error: Not Found')
20151116 11:51:51 Check classe CIM_Processor
20151116 11:51:51 Unknown CIM Error: (0, 'HTTP error: Not Found')
20151116 11:51:51 Check classe CIM_RecordLog
20151116 11:51:51 Unknown CIM Error: (0, 'HTTP error: Not Found')
20151116 11:51:51 Check classe OMC_DiscreteSensor
20151116 11:51:51 Unknown CIM Error: (0, 'HTTP error: Not Found')
20151116 11:51:51 Check classe OMC_Fan
20151116 11:51:52 Unknown CIM Error: (0, 'HTTP error: Not Found')
20151116 11:51:52 Check classe OMC_PowerSupply
20151116 11:51:52 Unknown CIM Error: (0, 'HTTP error: Not Found')
20151116 11:51:52 Check classe VMware_StorageExtent
20151116 11:51:52 Unknown CIM Error: (0, 'HTTP error: Not Found')
20151116 11:51:52 Check classe VMware_Controller
20151116 11:51:52 Unknown CIM Error: (0, 'HTTP error: Not Found')
20151116 11:51:52 Check classe VMware_StorageVolume
20151116 11:51:52 Unknown CIM Error: (0, 'HTTP error: Not Found')
20151116 11:51:52 Check classe


ck from Wil, Switzerland wrote on Nov 16th, 2015:

Chris and Matthias, please show information about the OS (Distro, version, etc) and also how you installed pywbem and which version.


Matthias Koch from wrote on Nov 16th, 2015:

Same problem here. Here's my command:

# ./check_esxi_hardware.py -H [hostname]:8443 -U [myID] -P [myPasswd] -v -V hp

...and here's the output:

20151116 11:51:51 Connection to https://[hostname]:8443
20151116 11:51:51 Found pywbem version 0.7.0
20151116 11:51:51 Connection error, disable SSL certification verification (probably patched pywbem)
20151116 11:51:51 Check classe OMC_SMASHFirmwareIdentity
20151116 11:51:51 Unknown CIM Error: (0, 'HTTP error: Not Found')
20151116 11:51:51 Check classe CIM_Chassis
20151116 11:51:51 Unknown CIM Error: (0, 'HTTP error: Not Found')
20151116 11:51:51 Check classe CIM_Card
20151116 11:51:51 Unknown CIM Error: (0, 'HTTP error: Not Found')
20151116 11:51:51 Check classe CIM_ComputerSystem
20151116 11:51:51 Unknown CIM Error: (0, 'HTTP error: Not Found')
20151116 11:51:51 Check classe CIM_NumericSensor
20151116 11:51:51 Unknown CIM Error: (0, 'HTTP error: Not Found')
20151116 11:51:51 Check classe CIM_Memory
20151116 11:51:51 Unknown CIM Error: (0, 'HTTP error: Not Found')
20151116 11:51:51 Check classe CIM_Processor
20151116 11:51:51 Unknown CIM Error: (0, 'HTTP error: Not Found')
20151116 11:51:51 Check classe CIM_RecordLog
20151116 11:51:51 Unknown CIM Error: (0, 'HTTP error: Not Found')
20151116 11:51:51 Check classe OMC_DiscreteSensor
20151116 11:51:51 Unknown CIM Error: (0, 'HTTP error: Not Found')
20151116 11:51:51 Check classe OMC_Fan
20151116 11:51:52 Unknown CIM Error: (0, 'HTTP error: Not Found')
20151116 11:51:52 Check classe OMC_PowerSupply
20151116 11:51:52 Unknown CIM Error: (0, 'HTTP error: Not Found')
20151116 11:51:52 Check classe VMware_StorageExtent
20151116 11:51:52 Unknown CIM Error: (0, 'HTTP error: Not Found')
20151116 11:51:52 Check classe VMware_Controller
20151116 11:51:52 Unknown CIM Error: (0, 'HTTP error: Not Found')
20151116 11:51:52 Check classe VMware_StorageVolume
20151116 11:51:52 Unknown CIM Error: (0, 'HTTP error: Not Found')
20151116 11:51:52 Check classe


ck from Switzerland wrote on Aug 3rd, 2015:

Hi Chris, please show the full error message from the verbose output. The line you copied is actually just an informative output, that the initial test connection failed and that the script assumes, that a patched pywbem version is around. Maybe the connection error comes from something else and is not related to the pywbem package.


Chris from Sydney wrote on Aug 2nd, 2015:

Hi, I have this version:
check_esxi_hardware.py 20150710

but am still getting the error:
20150802 17:13:32 Connection error, disable SSL certification verification (probably patched pywbem)

12.04, py-wbem 7.04 from ubuntu packages

I've had a look through the comments about editing lines to add:

no_verification=True)

but I can see that you have these already between 585 & 599.

Any suggestions on what I should try?

Also... is there any way of getting this to query vcenter and not the host?

Cheers,

Chris


RSS feed

Blog Tags:

  AWS   Android   Ansible   Apache   Apple   Atlassian   BSD   Backup   Bash   Bluecoat   CMS   Chef   Cloud   Coding   Consul   Containers   CouchDB   DB   DNS   Database   Databases   Docker   ELK   Elasticsearch   Filebeat   FreeBSD   Galera   Git   GlusterFS   Grafana   Graphics   HAProxy   HTML   Hacks   Hardware   Icinga   Influx   Internet   Java   KVM   Kibana   Kodi   Kubernetes   LVM   LXC   Linux   Logstash   Mac   Macintosh   Mail   MariaDB   Minio   MongoDB   Monitoring   Multimedia   MySQL   NFS   Nagios   Network   Nginx   OSSEC   OTRS   Office   PGSQL   PHP   Perl   Personal   PostgreSQL   Postgres   PowerDNS   Proxmox   Proxy   Python   Rancher   Rant   Redis   Roundcube   SSL   Samba   Seafile   Security   Shell   SmartOS   Solaris   Surveillance   Systemd   TLS   Tomcat   Ubuntu   Unix   VMWare   VMware   Varnish   Virtualization   Windows   Wireless   Wordpress   Wyse   ZFS   Zoneminder