Install MRTG for RHE or CentOS & cPanel

The Multi Router Traffic Grapher (MRTG) is a tool to monitor the traffic load on network-links. MRTG generates HTML pages containing graphical images which provide a LIVE visual representation of this traffic. MRTG is based on Perl and C and works under UNIX and Windows NT. MRTG is being successfully used on many sites around the net.

Please note this How To guide and files are for Red Hat Enterprise or
CentOS & CPanel Only. It will not work without CPanel.

1. Login to your server via SSH as root.

2. Make sure MRTG is NOT installed.
Type: rpm -e mrtg
It should come back with: error: package mrtg is not installed.

3. Now we will download GPan’s modified version of MRTG so that it works with
CPanel.
Type: wget http://www.dedicated-resources.com/files/mrtg-2.9.17-1cpanel.i386.rpm

4. Now we will install the MRTG RPM File.
Type: rpm -Uvh mrtg-2.9.17-1cpanel.i386.rpm

5. Login to WHM as root.

6. Find “Software” on the left hand menu.
Click “Install an RPM

7. Install the package “gnome-libs

8. Exit the internet browser, and switch back over to the Shell. (SSH)

9. We now need to remove some things that are not compatible.
Type: rpm -e –nodeps libpng10

10. Type: cd /usr/lib

11. Type: ln -s libpng.so.3 libpng.so.2

12. Now we are ready to start MRTG for the first time.
Type: /etc/rc.d/init.d/mrtg restart
This will most likely cause errors, and you will have to run
/etc/rc.d/init.d/mrtg restart
probably 3-5 more times to eliminate all of the errors.

If after restarting 5 times you receive this error: ls: /var/spool/exim/input/*-H:
No such file or directory
Exit SSH, and then reconnect to your server as
root and
Type: /etc/rc.d/init.d/mrtg restart
That should fix the problem, if not give it 1 day and then restart again and
see if the error is fixed. This error is related to files not being created
yet.

13. Ok, once you have restarted (3-5 times) there is a couple more things we
have to do.

14. We need to tell up2date or YUM
to NOT update MRTG or it will crash and destroy all we have done.

15. Type: up2date –configure

16. Now find where it says “pkgSkipList” and type the number directly
to the left of it (normally 8 or 9)

17. Copy the current value and at the end add mrtg*; then press enter

18. Press Enter

19. or for YUM if you are running CentOS or Fedora

20. Type locate Yum.conf which
should tell you where to find your yum.conf
most likely it is in /etc so type pico /etc/yum.conf
and add MRTG into the exclude= line which should
be the second from the top

21. To view MRTG in your internet browser type: http://yoursite.com/mrtg/

22. MRTG for Red Hat Enterprise or CentOS & cPanel is now installed

Leave a Reply