check_esxi_hardware now supports regular expressions for elements in ignore list

Written by - 0 comments

Published on - Listed in VMware Virtualization Hardware Monitoring


A new version (v 20190510) of the monitoring plugin check_esxi_hardware is available! 

This version has a new feature: An additional parameter (-r/--regex) was added to enable regular expression lookup for each element of the ignore list. Let's show this with a practical example.

Without the new -r parameter, as before, the plugin tries to find a 1:1 match of each element of the given ignore list:

# ./check_esxi_hardware.py -H esxhost -U root -P secret -V auto -v -i '.*Cache','CPU1 Level-1 Cache'
[...]
20190503 17:15:18 Check classe CIM_Memory
20190503 17:15:18   Element Name = CPU1 Level-1 Cache
20190503 17:15:18     (ignored)
20190503 17:15:18   Element Name = CPU1 Level-2 Cache
20190503 17:15:18     Element Op Status = 0
20190503 17:15:18   Element Name = CPU1 Level-3 Cache
20190503 17:15:18     Element Op Status = 0
20190503 17:15:18   Element Name = CPU2 Level-1 Cache
20190503 17:15:18     Element Op Status = 0
20190503 17:15:18   Element Name = CPU2 Level-2 Cache
20190503 17:15:18     Element Op Status = 0
20190503 17:15:18   Element Name = CPU2 Level-3 Cache
20190503 17:15:18     Element Op Status = 0
20190503 17:15:18   Element Name = Memory
20190503 17:15:18     Element Op Status = 2
[...]
OK - Server: Cisco Systems Inc UCSB-B200-M4 s/n: XXXXXXXXXXX Chassis S/N: XXXXXXXXXXX  System BIOS: B200M4.3.2.3a.0.0226182120 2018-02-26

Here only one element (CPU1 Level-1 Cache) was ignored, because it matched the element from the ignore list (-i parameter).

By adding the new -r parameter, each element of this ignore list will become a regex lookup:

# ./check_esxi_hardware.py -H esxhost -U root -P secret -V auto -v -i '.*Cache','CPU1 Level-1 Cache' -r
[...]
20190503 17:17:40 Check classe CIM_Memory
20190503 17:17:41   Element Name = CPU1 Level-1 Cache
20190503 17:17:41     (ignored through regex)
20190503 17:17:41     (ignored through regex)
20190503 17:17:41     (ignored)
20190503 17:17:41   Element Name = CPU1 Level-2 Cache
20190503 17:17:41     (ignored through regex)
20190503 17:17:41     (ignored)
20190503 17:17:41   Element Name = CPU1 Level-3 Cache
20190503 17:17:41     (ignored through regex)
20190503 17:17:41     (ignored)
20190503 17:17:41   Element Name = CPU2 Level-1 Cache
20190503 17:17:41     (ignored through regex)
20190503 17:17:41     (ignored)
20190503 17:17:41   Element Name = CPU2 Level-2 Cache
20190503 17:17:41     (ignored through regex)
20190503 17:17:41     (ignored)
20190503 17:17:41   Element Name = CPU2 Level-3 Cache
20190503 17:17:41     (ignored through regex)
20190503 17:17:41     (ignored)
20190503 17:17:41   Element Name = Memory
20190503 17:17:41     Element Op Status = 2
[...]
OK - Server: Cisco Systems Inc UCSB-B200-M4 s/n: XXXXXXXXXXX Chassis S/N: XXXXXXXXXXX  System BIOS: B200M4.3.2.3a.0.0226182120 2018-02-26

This time all the ".*Cache" elements were ignored. An additional info is shown in the verbose output (ignored through regex) in case someone ignores too many elements with a bad regex.

By default this regex lookup is disabled to not break existing monitoring configurations. It you want to enable regular expressions for your ignore list, use the new -r/--regex parameter. The documentation has been adjusted.


Add a comment

Show form to leave a comment

Comments (newest first)

No comments yet.