MRTG : Montoring Network Bandwidth of Linux Servers

About MRTG:

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.

Download MRTG:

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.

Part 1: 

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

Part 2: 

   In Part 2 , we will start configuring MRTG to monitor the above Linux Servers.

mkdir /var/www/html/mrtg
/usr/local/mrtg-2/bin/cfgmaker  --global "workdir: /var/www/html/mrtg "   --global "options[_]: growright,bits"   zaman@  zaman@ zaman@  --output=/etc/mrtg/mrtg.cfg
 env LANG=C /usr/local/mrtg-2/bin/mrtg /etc/mrtg/mrtg.cfg        (Execute this command two or
                                                                                                           three times)  

/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


jacks sparrow said…
Any performance issues that arise with your network are also able to be found when you use a network bandwidth monitor tools.....

Popular posts from this blog

How to add check_http as a service in Nagios Monitoring using NRPE

PSSH : Parallel SSH to execute commands on a number of hosts

Using lsof to identify deleted files: