check_esxi_hardware 20221230 released: Bugfix when no Serial Number detected (NoneType)

Written by - 0 comments

Published on - Listed in Hardware VMware Virtualization Monitoring Coding


A new version of check_esxi_hardware, an open source monitoring plugin to monitor the hardware of VMware ESXi servers, is available.

The newest release (20221230) fixes a bug (issue #68), when a (Chassis) Serial Number is not detected from the parsed CIM elements. I came across this bug when testing plugin compatibility with a new VMware ESXi 8 installed as a virtual machine.

$ ./check_esxi_hardware.py -H esxiserver -U root -P password
Traceback (most recent call last):
  File "./check_esxi_hardware.py", line 1070, in <module>
    print("OK - Server: %s %s %s%s" % (server_info, 's/n: ' + SerialNumber, bios_info, perf))
TypeError: can only concatenate str (not "NoneType") to str

The (Python) problem? The script tries to combine (concatenate) a variable "SerialNumber" with a string "s/n". But as there was no SerialNumber found from the CIM output, this variable is empty and is seen as "NoneType" by Python.

In version 20221230 the "s/n" string is now a fixed part of the output and will either contain a retrieved serial number or "None".

$ ./check_esxi_hardware.py -H esxiserver -U root -P password
OK - Server: QEMU Standard PC (Q35 + ICH9, 2009) s/n: None System BIOS: 1.12.0-1 2014-04-01



Add a comment

Show form to leave a comment

Comments (newest first)

No comments yet.

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