MRTG - The Multi Router Traffic Grapher
Introduction
You have a router, you want to know what it does all day long? Then MRTG is for you. It will monitor SNMP network devices and draw pretty pictures showing how much traffic has passed through each interface.
Notes
This documentation is accurate as of April 6, 2012. These steps have been performed on Ubuntu 10.04.4 Server systems and confirmed to work as described here.
Prerequisites
It's generally a good idea to start with a healthy, fully functioning, up-to-date system. This means that some combination of sudo apt-get update, sudo apt-get upgrade, sudo apt-get dist-upgrade, and sudo apt-get autoremove should have been recently run. Please understand what the commands do before blindly running them as any system update has the potential to render a system inoperable.
Specifically apache and snmpd needs to be installed. Apache is the web server and snmpd is used to poll devices for information that mrtg can use to create graphs. This can be accomplished by running:
sudo apt-get install apache2
and
sudo apt-get install snmpd
Installation
To install MRTG, simply run:
sudo apt-get install mrtg
Configuration
MRTG
Now that mrtg is installed, we must create a home where web pages related to the program can reside.
sudo mkdir /var/www/mrtg
Backup the original /etc/mrt.cfg file:
sudo cp /etc/mrtg.cfg /etc/mrtg.cfg.ORIGINAL
Create a configuration file for MRTG:
cfgmaker <snmp_community_string>@<ip_address_of_device_to_be_monitored> > /etc/mrtg.cfg
Create and index file for the webserver :
indexmaker /etc/mrtg.cfg > /var/www/mrtg/index.html
Reboot your server and wait about 5 minutes before browsing to: