How to install MRTG on Your Cpanel Server
The Multi Router Traffic Grapher(MRTG), is free software for monitoring and measuring the traffic load on network links. MRTG generates HTML pages containing graphical images which provide a LIVE visual representation of this traffic. How does it work? MRTG uses the Simple Network Management Protocol (SNMP) to send requests with two object identifiers (OIDs) to a device. The device, which must be SNMP-enabled, will have a management information base (MIBs) to lookup the OID’s specified. After collecting the information it will send back the raw data encapsulated in an SNMP protocol. MRTG records this data in a log on the client along with previously recorded data for the device. The software then creates an HTML document from the logs, containing a list of graphs detailing traffic for the selected device.
Following describes how to install MRTG in the cpanel server.
MRTG download mirror :
Installing the rpm :
rpm -ivh mrtg-2.9.17-1cpanel.i386.rpm
Move the old version of libpng
mv libpng.so.2 libpng.so.2.OLD
# Creating the symlink
ln -s libpng.so.3 libpng.so.2
# Edit language at and change it to “en_US”
# Restarting MRTG
After the installation you can use http://serverip/mrtg/ to access the mrtg page.
Initially you will get lot of warning when the service gets started, try restarting the mrtg service several times to update the conf, it will start working after few hours.
Mtrg stats may not show properly if you using 64 bit OS/server and on a 1000 mbits port. To overcome the issue, you need to download the mrtg from source and use the snmp version 2 as below to solve the problem.
cfgmaker –global ‘WorkDir:/<your installation dir>’ –global “Options[_]:bits,growright” –snmp-options=:::::2 -output /etc/mrtg/mrtg.cfg [email protected]
Screen-shot (in mbits) :
Mrtg in Mbits