Wednesday, September 3, 2008

check_iostat and check_multi - perfdata discarded bad UOM ','

i had this dumb issue today.

The plugin check_iostat returned wrong perfdata. check_multi discards perfdata that is not returned like its defined in the nagios developer guidelines so i wasnt able to get perfdata from my check_iostat checks within a check_multi Service.

So i just 'patched' (is it possible to "patch" shell scripts? - dont think so ;-) ) the plugins.
I Just replaced the last lines where the performance data is returned with my own ones which do replace all 'comma' with 'dots'. It is looking like this:

UPDATE: I recognized that the whole perfdata output wrong, not even the issue with the commata there was even an issue with the order of the returned values, here is how it is working for me:

# Perfdata support
#${ECHO} "$msg|ioread=${ioread}c;${CRITICALREAD};${WARNINGREAD};0;iowrite=${iowrite}c;${CRITICALWRITE};${WARNINGWRITE};0; \n"
MYPERF="$msg|ioread=${ioread}kByte/s;${WARNINGREAD};${CRITICALREAD};0;0;iowrite=${iowrite}kByte/s;${CRITICALWRITE};${WARNINGWRITE};0;"
MYPERF=`echo "$MYPERF" | sed 's/\(,\)\([0-9]*\)/\.\2/g'`
echo $MYPERF
exit ${exitstatus}


Hope this helps somebody.

bohboh,
kratediggah

No comments: