[mrtg] newbie question: how to convert string -> value?

Niall O'Reilly Niall.oReilly at ucd.ie
Fri Feb 27 12:44:17 CET 2009


On Fri, 2009-02-27 at 03:26 -0800, Evert wrote:
> How do I configure this in mrtg.conf so that I get something I can
> graph?

	Look in the MRTG reference (master copy is 
	http://oss.oetiker.ch/mrtg/doc/mrtg-reference.en.html, other
	copies are everywhere MRTG is installed) for 'External 
	monitoring scripts'.

	You'll need to post-process the output from your SNMP
	collector, perhaps like this:

echo '    STRING: 0.35' \
| perl -ne 's/.*:\s+//; printf "%d\n0\n0\n0\n\n", 100*$_; exit'

	I've assumed it makes sense to convert the load average
	to a percentage.  This may (or not) fit your needs.

	YMMV and good luck!

	Niall O'Reilly




More information about the mrtg mailing list