[Check_mk (english)] check ipmi-sensors is broken in agent 1.2.6p5 upwards

Olaf Morgenstern mistkerl473 at gmx.de
Wed Jul 8 15:30:36 CEST 2015


Hi,

we actually upgrade from version 1.2.4p5 to 1.2.6p5.
There was a main change to the code of this check between version 1.2.4p5 and version 1.2.6p5.

I realized that the check "ipmi-sensors" is broken:
- it never returns any output different from <<<ipmi_sensors>>>
- it returns a double header <<<ipmi_sensors>>>

It seems nobody is actually using this check. ;-)

To get the check working again, only two minor changes are necessary:

=== snip ===
--- check_mk_agent.1.2.6p5-1 2015-07-06 08:48:57.000000000 +0200
+++ check_mk_agent 2015-07-08 15:21:29.000000000 +0200
@@ -286,7 +286,6 @@
# have installed freeipmi that IPMI is really support by your hardware.
if type ipmi-sensors >/dev/null
then
- echo '<<<ipmi_sensors>>>'
# Newer ipmi-sensors version have new output format; Legacy format can be used
if ipmi-sensors --help | grep -q legacy-output; then
IPMI_FORMAT="--legacy-output"
@@ -296,7 +295,7 @@
# At least with ipmi-sensoirs 0.7.16 this group is Power_Unit instead of "Power Unit"
run_cached -s ipmi_sensors 300 "for class in Temperature Power_Unit Fan
do
- ipmi-sensors $IPMI_FORMAT --sdr-cache-directory /var/cache -g "$class" | sed -e 's/ /_/g' -e 's/:_\?/ /g' -e 's@ \([^(]*\)_(\([^)]*\))@ \2_\1@'
+ ipmi-sensors $IPMI_FORMAT --sdr-cache-directory /var/cache -g \$class | sed -e 's/ /_/g' -e 's/:_\?/ /g' -e 's@ \([^(]*\)_(\([^)]*\))@ \2_\1@'
# In case of a timeout immediately leave loop.
if [ $? = 255 ] ; then break ; fi
done"
=== snap ===

That is, delete line 289 and change "$class" to \$class in line 299.

Please add this change to the next stable release.

Regards,
omo


More information about the checkmk-en mailing list