How to configure MRTG - The Multi Router Traffic Grapher

MRTG or The Multi Router Traffic Grapher can be used to monitor SNMP network devices and displays the traffic that has passed through each interface.

Log in to your server as root.

First you should create a folder to store mrtg graphs/html pages
# mkdir -p /var/www/html/mymrtg/

Use cfgmaker command to create mrtg configuration file
# cfgmaker --global 'WorkDir: /var/www/html/mymrtg' --output /etc/mrtg/mymrtg.cfg public@localhost

Now you should create default index page for your MRTG configuration
# indexmaker --output=/var/www/html/mymrtg/index.html /etc/mrtg/mymrtg.cfg

Copy all tiny png files to your mrtg path
# cp -av /var/www/html/mrtg/*.png /var/www/html/mymrtg/

Now test if MRTG is running fine:

(a) Run mrtg command from command line with your configuration file:

Run this command
# mrtg /etc/mrtg/mymrtg.cfg

You may get few warning message for first time, thats ok, ignore them.

Check the next url:

http://www.yourhost.com/mymrtg/
or
http://serverip/mymrtg/

Visit MRTG web site.

0 Comments: