MRTG : Montoring Network Bandwidth of Linux Servers
MRTG stands for Multi Router Traffic Grapher is a free software for monitoring and measuring the traffic load on network devices . MRTG is written in perl and works on Unix/Linux as well as Windows and even Netware systems. MRTG is free software licensed under the Gnu GPL.
MRTG is available for download from
Steps to install MRTG is available here
Configuring MRTG:We will be using MRTG to monitor traffic flow of three Linux based servers . In order to proceed further , we need to configure SNMP on these Linux Servers . Following are the steps to be followed to configure SNMP . In part 2 , we will steps to configure MRTG to monitor these Linux servers.
1. Install following net-snmp tools on all the three servers.
2. Start snmpd service as root
service snmpd start
chkconfig snmpd on
3. Default community string is 'public' . If you want to change the default community string , then edit the
following line in /etc/snmp/snmpd.conf and change the default community string
com2sec notConfigUser default zaman
In Part 2 , we will start configuring MRTG to monitor the above Linux Servers.
/usr/local/mrtg-2/bin/cfgmaker --global "workdir: /var/www/html/mrtg " --global "options[_]: growright,bits" email@example.com firstname.lastname@example.org email@example.com --output=/etc/mrtg/mrtg.cfg
env LANG=C /usr/local/mrtg-2/bin/mrtg /etc/mrtg/mrtg.cfg (Execute this command two or
/usr/local/mrtg-2/bin/indexmaker /etc/mrtg/mrtg.cfg --output=/var/www/html/mrtg/index.html
With this we are done configuring MRTG . We can now start monitoring network traffic using the following
We can schedule a cron job so that Linux Servers are polled every 5 or 10 minutes gap by MRTG to generate graph . Following is the entry we can configure it in
*/5 * * * * root /usr/local/mrtg-2/bin/mrtg /etc/mrtg/mrtg.cfg --logging /var/log/mrtg.log