[mrtg] Graphing netware disk usage

Steve Shipway s.shipway at auckland.ac.nz
Fri Nov 26 20:41:42 CET 2010

You are using a Nagios plugin in MRTG.  While some Nagios plugins have an 'MRTG Mode', it seems that this one doesn't (or if it does, you've not enabled it).  

A Nagios plugin should output one line of text, with a message followed by '|' and the perfstats data as var=value sets.  It then exits with a status of 0,1,2 or 3 depending on the tests.

An MRTG plugin should output 4 lines of text; two with numbers and then two more optionally holding uptime and system name (though these can be left blank).  It should always exit with status 0.

In order to make this work with MRTG, you'll need to modify the plugin to output MRTG status, or use a wrapper script like this:

# check_nwstat_mrtg
perfstat=`/usr/lib/nagios/plugins/check_nwstat $* | cut -f2 -d '|'`
val=`echo "$perfstat"|sed 's/^.*=//'|sed 's/;.*//'`
echo $val
echo $val
echo ''
echo "$perfstat"
exit 0


Steve Shipway
University of Auckland ITS
UNIX Systems Design Lead
s.shipway at auckland.ac.nz
Ph: +64 9 373 7599 ext 86487

From: mrtg-bounces+s.shipway=auckland.ac.nz at lists.oetiker.ch [mrtg-bounces+s.shipway=auckland.ac.nz at lists.oetiker.ch] on behalf of PeteH [peter.hickling at nhs.net]


Target[VCH-NA1.SYS]:  `/usr/lib/nagios/plugins/check_nwstat -v VKFSYS | cut -f2 -d =`
nagios1:/etc/init.d # /usr/lib/nagios/plugins/check_nwstat -v VKFSYS
1126912 KB free on volume SYS|KBFreeSYS=1126912;0;0;;
nagios1:/etc/init.d # /usr/lib/nagios/plugins/check_nwstat -v VKFSYS | cut -f2 -d =

More information about the mrtg mailing list