[mrtg] MRTG "autoconfiguration" script

Michael W. Lucas mwlucas at blackhelicopters.org
Thu Jan 29 20:18:52 MET 2004


I run MRTG on a whole bunch of systems to graph all sorts of stuff
across both Windows and UNIXlike platforms.  What's more, every so
often I have to add additional MIBs to monitor, and update all of the
config files with that new information.

The obvious thing to do in this case is write a Perl script that
identifies what MIBs the target host supports, walks the tree to
configure a target for each interface, filesystem, CPU, and so forth,
and then spits out a MRTG configuration file.

I know that cfgmaker supports "templates," but templates aren't quite
the same.  Each of my systems has a varying number of filesystems,
CPUs, and so on.

If this would be useful to you, grab it from

This targets the following SNMP engines:

Dell Windows agent
SNMP2CA (very new, probably incomplete or otherwise scary)

and spits out a MRTG config file that targets the following on each

network interfaces (all agents)
cpu utilization (all agents)
available memory (all agents, with petty trouble for snmp2ca)
available swap (dell and net-snmp)
disk usage (all agents)
current process count (all agents)
current load (net-snmp)

Be warned: I am not a programmer, and I learned Perl back in the days
of vanilla Perl 4.  This code probably makes babies cry, and would
offend Aleister Crowley if he was still alive.  (Actually, if you dig
him up and show it to him he'll probably be offended anyway.)  But it
works, which is what matters to me.


Michael Lucas		mwlucas at FreeBSD.org, mwlucas at BlackHelicopters.org

Today's chance of throwing it all away to start a goat farm: 42.8%

Unsubscribe mailto:mrtg-request at list.ee.ethz.ch?subject=unsubscribe
Archive     http://www.ee.ethz.ch/~slist/mrtg
FAQ         http://faq.mrtg.org    Homepage     http://www.mrtg.org
WebAdmin    http://www.ee.ethz.ch/~slist/lsg2.cgi

More information about the mrtg mailing list