Setting up MRTG on Debian
Here's what I did to set up MRTG on
a debian box:
Installed snmpd (MRTG uses snmpd for network monitoring.
Changed the snmpd config file to uncomment the "readonly" entry and comment
out the "paranoid" entry. The new configuration looks like this:
# sec.name source community
#com2sec paranoid default public
com2sec readonly default public
#com2sec readwrite default private
Restarted snmpd after this:
# /etc/init.d/snmpd restart
Changed my webserver config files so that /var/www/mrtg is aliased to an
appropriate subdirectory (you don't need to do this if /var/www is already your
DocumentRoot, this is the debian default).
Added the following info to my /etc/mrtg.cfg file:
I prefer to follow Debian's convention of running mrtg every five minutes
from a cron job as opposed to running it as a daemon. If you'd rather run mrtg
as a daemon, just set RunAsDaemon to "yes" - the cron job will then just become
a keepalive job.
Ran " cfgmaker email@example.com >> /etc/mrtg.cfg" to create
the monitoring for the network interfaces on localhost.
Ran " indexmaker /etc/mrtg.cfg > /var/www/mrtg/index.html" to
regenerate the index page (you need to do this when making configuration changes
that add stuff to mrtg).
And now I have some spiffy bandwidth graphs. Thanks MRTG guys!