Highlighting patch for Nagios plugin check_lm_sensors

This patch provides a highlighting facility which highlights any sensor values which have broken their warning or critical bounds.  It is for check_lm_sensors version 3.1.1.

To use, append the --highlighting option to the check_lm_sensors command line in /etc/nagios/nrpe.cfg, /etc/nrpe.d/whatever and see, eg.

LM_SENSORS WARNING - fan1=4054fan2=4041 System_Temperature=25.0 CPU_Temperature=39.5 Chipset_Temperature=39.2 +12V=12.17 Vcore CPU=*WR_1.33_WR* +3.3V=3.31 HT Voltage=1.21 +5V=5.19 Vdimm CPU=1.51 -12V=-12.08 1.1V=1.11 +3.3Vsb=3.26

instead of,

LM_SENSORS WARNING - fan1=4054fan2=4041 System_Temperature=25.0 CPU_Temperature=39.5 Chipset_Temperature=39.2 +12V=12.17 Vcore CPU=1.33 +3.3V=3.31 HT Voltage=1.21 +5V=5.19 Vdimm CPU=1.51 -12V=-12.08 1.1V=1.11 +3.3Vsb=3.26
in your emailed and web UI reports.  I found this much more convenient than having to wade through the above O/P with a calculator to work out which parameter(s) was responsible for the LM_SENSORS WARNING.

Highlights

The highlights are of the form *XY_<sensor_value>_XY* where X=W for warning and C for critical. Y=R for range violation, L for a low value violation, H for a high value violation and C for an old-style check violation.


T.Crane, 13th July 2015.