shopify analytics ecommerce

RHEL / CentOS install MRTG

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:

# yum install mrtg net-snmp net-snmp-utils

2. Setup SNMP:
edit /etc/snmp/snmpd.conf and add this line:

rocommunity mrtg

save the file snmpd.conf and restart snmpd:

# chkconfig snmpd on
# /etc/rc.d/init.d/snmpd restart

3. Setup MRTG

Create MRTG’s config file with cfgmaker command:

# cfgmaker –global ‘WorkDir: /var/www/mrtg’ –output /etc/mrtg/mrtg.cfg [email protected]

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:

# indexmaker –output=/var/www/mrtg/index.html /etc/mrtg/mrtg.cfg

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.

http://localhost/mrtg/

Leave a Reply