MRTG (Multi Router Traffic Grapher) is a traffic monitoring tools based on SNMP protocol, this is the steps of install MRTG on RHEL and CentOS
1. Install MRTG:
2. Setup SNMP:
edit /etc/snmp/snmpd.conf and add this line:
save the file snmpd.conf and restart snmpd:
# /etc/rc.d/init.d/snmpd restart
3. Setup MRTG
Create MRTG’s config file with cfgmaker command:
The above command will create file /etc/mrtg/mrtg.cnf, /var/www/mrtg is the working directory of MRTG, which will save html and png files of MRTG. [email protected] is the setting on /etc/snmp/snmpd.conf.
Now execute indexmaker create traffic’s webpages:
4. Setup crontab
Execute crontab -e and add this line, it will make MRTG auto update traffic data every 5 mins:
*/5 * * * * /usr/bin/mrtg /etc/mrtg/mrtg.cfg
When you want access MRTG page, just add /mrtg after your server’s hostname, e.g.