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:

http://<server_ip>/mrtg

Third Section

Some sections may just contain a list of links. It is sometimes useful to include a short explanation of what the links are for. For example: 'Ubuntu includes the following Internet applications by default.'

  • <Link> - Lists of links should have bullets. Link text should not be in bold. Each link should be followed by a short explanation of the link.

  • <Link> - Explanations of links should be written as full sentences.

See Also

A see also section can be used to point users towards other trusted Ubuntu resources. For example, if a page exists in the official documentation on http://help.ubuntu.com, you can link to such a page. This section is optional.

  • <Link> - Explanation of link.

  • <Link> - Explanation of link.

  • <Link> - Explanation of link.

External Links

An external links section can be used to point users towards general information about the subject matter of the page, such as a wikipedia entry or project homepage. This section is optional.

MRTG (last edited 2012-04-26 22:57:19 by 107-0-86-238-ip-static)