mrtg: Multi Router Traffic Grapher (1.6)

Created by <oetiker@dmu.ac.uk>
This program is distributed under the GNU copyleft.

News for Version 1.6

Thanks to Johannes Demel (demel@edvz.tuwien.ac.at) and Mike Convey (mike@novell.co.uk) for their patches. They were the main inspiration for this release.

Description

The Multi Router Traffic Grapher is a perl5 script. It can be used to monitor a number of Internet links. It produces a html page which contains 4 graphs, showing the load on the link over the last 31 hours, 8 days, 31 days and 365 days respectively. Check The stats of DMU's Internet Link see a sample output.

The program runs as a cron job and is therefore quite robust to system crashes. The data from the routers is acquired through an SNMP agent. Currently it supports snmpget from the cmu-snmp distribution, the snmp-get from the tricklet package by Delft University and the getone tool found preinstalled on some systems. The graphs are produced with ppmtogif from the netpbm package.

Man Page

Command line:
mrtg mrtg.cfg
Synopsis:
This tool, when started up regularly, through a crontab, creates a daily, weekly and yearly graph, representing the incoming and outgoing traffic on a snmp manageable router. The tool also produces a HTML document around the graphics for easy access on a web server.
Configuration:
The operation of the "mrtg" is governed by entries in the configuration file. The filename of the configuration file must be specified as a command line argument when calling "mrtg"
Installation:
Adapt the configuration file to your needs. Then put up a crontab which starts "mrtg" every five minutes. If for some reasons mrtg misses on reading, this doesn't matter, it will automatically take that into account.

Example Config File


# Multi Router Traffic Grapher -- Configuration File
#######################################################################
 
# General Configuration ###############################################
#######################################################################

WorkDir: /usr/local/www/data/dept/admin/dld/lin/netcomm/traffic

# how nice shall we be ? (0 is the fastest)
nice:   10  

# Currently the following 3 "snmpgets" are supported
# cmu: from cmu-snmp 
# delft: SNMP distribution by tu-delft
# getone:   On some systems this is already installed 
snmpagent:  cmu 

# The path to the "snmpget" utility
snmpget: /home/oetiker/bin/snmpget

# cmu-snmpget needs to know the path to mib.txt 
mibfile: /home/oetiker/etc/mib.txt

# The ppm to gif converter from the netpbm package
ppmtogif: /usr/local/bin/ppmtogif 
 
# Configuration for our CISCO Gateway #################################
#######################################################################
 
IP[jips]: 146.227.1.248
Community[jips]: public
MaxBytes[jips]: 8000   
Title[jips]: Traffic Analysis for DMU's Internet Gateway
 
Comment[jips]: Our Internet link curently runs over a 64Kb X.25 Link.
  This gives a maximum throughput of 8 KBytes per Second.
 
ifOut[jips]: interfaces.ifTable.ifEntry.ifOutOctets.6
ifIn[jips]: interfaces.ifTable.ifEntry.ifInOctets.6 

# More routers can follow .....
################################

IP[xyz]: 156.222.2.1
MaxBytes[xyz]: 100000
...

# Combined Statistic for several Routers
########################################
# You DON'T need to specify MaxBytes, ifOut, ifIn and Community !

# specify the aliases from all the routers you want to include in
# the total.
# 
# mrtg tries to make sure that you only use aliases which were 
# defined elsewhere in the config file. Now you may want to include 
# statistics generated by another mrtg. To do this, add a star (*)
# after each external reference.

IP[summ]: xyz,jips,extern1*,extern2*
Comment[summ]: Combined Traffic off all our friends on the fddi ring
...


The latest version of this program is available from Tobias Oetiker <oetiker@dmu.ac.uk>