MRTG

How to configure MRTG

Install MRTG

sudo apt-get install -y mrtg mrtg-contrib snmp

Configure MRTG

vi /etc/mrtg.cfg
######################################################################
# Multi Router Traffic Grapher -- Sample Configuration File
######################################################################
# This file is for use with mrtg-2.5.4c
# Global configuration
WorkDir: /mnt/apps/mrtg
WriteExpires: Yes
RunAsDaemon: Yes
Refresh: 300
Interval: 5
Title[^]: Traffic Analysis for
# Router
# ----------------
Target[skinner-hme2]: 4:public@skinner
Options[skinner-hme2]: growright, integer
MaxBytes[skinner-hme2]: 500000
Title[skinner-hme2]: Traffic Analysis for skinner (hme2)
PageTop[skinner-hme2]:<h3>Traffic Analysis for skinner (hme2)</h3>

Configure Apache

sudo vi /etc/apache2/conf.d/mrtg
Alias /mrtg /mnt/apps/mrtg

Options FollowSymLinks
AllowOverride Limit Options FileInfo
DirectoryIndex index.html

Restart

sudo /etc/init.d/mrtg restart
sudo /etc/init.d/apache restart