The Multi Router Traffic Grapher (MRTG) is a tool to monitor the traffic load on network links. MRTG generates HTML pages containing graphical images which provide a live visual representation of the traffic.
MTRG Installation
1. Make a directory under /var/www/
- mkdir /var/www/html/mrtg
2. Create necassary folders and secure it.
- mkdir /var/www/html/mrtg/core
- chmod 700 /var/www/html/mrtg/core
3. Download and compile the tar file.
- wget http://people.ee.ethz.ch/~oetiker/webtools/mrtg/pub/mrtg.tar.gz
- tar zfx mrtg.tar.gz
- cd mrtg*
- ./configure —with-gd=/usr/local/lib
- make
- make install
This will install MRTG
4. The config and templates needs to be updated. Download the latest
updates and compile them also.
- wget http://www.serveio.com/da/mrtgcfg.tar.gz
- tar zfx mrtgcfg.tar.gz
- chmod +x system
Move files to necassary locations:
- mv -f system /var/www/html/mrtg/core
- mv -f mrtg.cfg /var/www/html/mrtg/core
This will update the MRTG Config and template
5. Adding cron tab entry. This part is up to you to decide at what
interval this should work. I have set this to work every 5 minutes.
Either edit the cron tab and manually add the entries or just run this
command below.
- echo "*/5 * * * * root /usr/local/mrtg-2/bin/mrtg
/var/www/html/mrtg/core/mrtg.cfg" » /etc/crontab
- echo "" » /etc/crontab
6. Executing the commands below will start the MRTG for the first time.
- /usr/local/mrtg-2/bin/mrtg
- /var/www/html/mrtg/core/mrtg.cfg
If you see any errors or warnings below, just ignore that ;-)
7. Clean up the installation by removing the folders.
- rm -rf mrtg*
Thats it, done. DONE!
When the process is done MRTG will be installed in: /var/www/html/mrtg
and can be viewed at: http://your.hostname.com/mrtg
Enjoy!!!