The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Install MRTG on RH9 in 10 Easy Steps

Discussion in 'cPanel Developers' started by asuservice, Feb 6, 2004.

  1. asuservice

    asuservice Well-Known Member

    Joined:
    Oct 24, 2001
    Messages:
    85
    Likes Received:
    0
    Trophy Points:
    6
    I just installed MRTG on 3 RH 9 machines using the following method.

    1: rpm -e mrtg
    2: rpm http://download.cheetaweb.com/mrtg-2.9.17-1cpanel.i386.rpm -Uvh
    (That's download.cheetaweb.com/mrtg-2.9.17-1cpanel.i386.rpm ... the forum script may cut it off)
    3: cd /usr/lib
    4: mv libpng.so.2 libpng.so.2.OLD ... OR rm libpng.so.2 (your choice)
    5: ln -s libpng.so.3 libpng.so.2
    6: pico /etc/sysconfig/i18n
    7: change LANG to LANG="en_US"
    8: Start and stop MTRG several times ignoring errors ... service mrtg start/stop/restart
    9: chkconfig --add mrtg
    10: Now check http://YourMainIP/mrtg/

    NOTE: You May See the following error three times on startup of mrtg ...
    ls: /var/spool/exim/input/*-H: No such file or directory

    This is normal ... don't worry about it.

    Thanks to gpan from the RackShack forums for this RPM!

    Thanks to Matt of MainArea.com for the origianl post for installing MTRG on RH7.3
    it saved me a lot of work and only had to have a couple tweaks to get it to work
    with RH9

    One last thing ...
    You'll notice the graphs "grow" from the left by default. Matt of MainArea.com
    has been nice enough to rework that with the "Grow Right" tweak. You can download
    that at http://www.webhostingtalk.com/attachment.php?s=&postid=1778633 then replace
    /etc/mrtg/mrtg.cfg with that file ...

    Hope this helps!
     
  2. Getox

    Getox BANNED

    Joined:
    Feb 4, 2004
    Messages:
    87
    Likes Received:
    0
    Trophy Points:
    0
  3. The MAzTER

    The MAzTER Well-Known Member

    Joined:
    Jul 3, 2003
    Messages:
    106
    Likes Received:
    0
    Trophy Points:
    16
    error: Failed dependencies:
    perl >= 5.004 is needed by mrtg-2.9.17-1cpanel
    :-/

    and cpanel downgraded perl a while ago i think
     
  4. mainarea

    mainarea Active Member

    Joined:
    Nov 18, 2002
    Messages:
    41
    Likes Received:
    0
    Trophy Points:
    6
    Perl should be over 5.004 on your machine... here's what my RH 9 machine shows:

    root@dallas [~]# perl -v
    This is perl, v5.8.1 built for i686-linux.


    MRTG install on RH 9 works fine for me, I haven't seen any issues besides the one that you posted. What does your perl -v show?

    - Matt
     
  5. The MAzTER

    The MAzTER Well-Known Member

    Joined:
    Jul 3, 2003
    Messages:
    106
    Likes Received:
    0
    Trophy Points:
    16
    This is perl, v5.8.0 built for i386-linux-thread-multi
     
  6. stuartj

    stuartj Member

    Joined:
    Jul 17, 2003
    Messages:
    18
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    UK
    I can also report this is stable with fedora core 1 based o/s servers no issues on 17 machines.

    Stuart
     
  7. razorhazor

    razorhazor Member

    Joined:
    Feb 21, 2004
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    1
    getting

    error while loading shared libraries: libpng.so.2?

    When I goto my IP/mrtg get HTTP 404 Not Found?
     
  8. stuartj

    stuartj Member

    Joined:
    Jul 17, 2003
    Messages:
    18
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    UK
    you can remove the file and re add the symbolic link then restart / stop a number of times the error should clear.
     
  9. razorhazor

    razorhazor Member

    Joined:
    Feb 21, 2004
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    1
    sorry newbie here!

    how do I re-add the symlink?
     
  10. razorhazor

    razorhazor Member

    Joined:
    Feb 21, 2004
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    1
    Just tried

    rm libpng.so.2
    ln -s libpng.so.3 libpng.so.2

    and still getting

    /usr/bin/rateup: error while loading shared libraries: libpng.so.2: cannot open shared object file: No such file or directory
     
  11. stuartj

    stuartj Member

    Joined:
    Jul 17, 2003
    Messages:
    18
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    UK
    What version of linux are you using ?
     
  12. razorhazor

    razorhazor Member

    Joined:
    Feb 21, 2004
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    1
    ahh! just checked RH 7.3!

    sorry for wasting your time, guess I cant have it then?
     
  13. stuartj

    stuartj Member

    Joined:
    Jul 17, 2003
    Messages:
    18
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    UK
    It should do I got it working with redhat 7 & 8 heres the exact commands i used.

    SSH in to your server as root

    use the following commands as posted in this order

    1. rpm -e mrtg
    This removes any existing mrtg rpm that may be installed.
    2. rpm http://download.cheetaweb.com/mrtg-2.9.17-1cpanel.i386.rpm -Uhv
    This will install the RPM & download from a server using this file.
    3. cd /usr/lib
    This takes you to the /usr/lib directory on the server hard disk
    4. locate libpng.so.2.old
    This will check if the file exists already if it does follow step ( a ) if not goto step 5
    ( a ) rm -f libpng.so.2.old
    This command will remove the old file only called libpng.so.2.old in /usr/lib
    5. mv libpng.so.2 libpng.so.2.OLD
    this moves the file to the .old file ( Backup )
    6. ln -s libpng.so.3 libpng.so.2
    This create the sybolic link to the libpng2.so.2 file to the files as required.
    7. pico /etc/sysconfig/i18n
    This opens the pine editor to allow you to edit the mrtg config files.
    8. change LANG to LANG="en_US"
    The line is the top line you need to remove some parts of the txt beyond "en_US.xxxx" so that the statement is as stated above on part 8
    9. service mrtg start/stop
    You need to do this a few times if the errors continue beyond 5 times you need to follow an extra few line if the errors stop showing on the 4/5th attempt you can jump to part 13
    10. cd /usr/bin
    this takes you to /usr/bin ( Be Very Carefull )
    11. rm -f *.old
    This removes the files that are causing the error as they may/may not exist.
    12. service mrtg start/stop run 4 times
    Run this and mrtg should start ok.
    13. chkconfig --add mrtg
    Add this line by typing the command in ssh.
    14. load your browser and http://ip/mrtg/
    loading mrtg in your browser note this needs to be the server IP not a non main ip.

    This has been tested on cpanel servers running redhat 7.2, 8.0, 9.0 & Fedora you should only do this if you know what your doing. If you lease a server from a provider your find that most will be willing to install it for you or seek a server admin who knows what they are doing there are many about.

    Again this is more help to the origanal poster on this thread and is treated as an addon for help with those who need a bit more help.

    Stuart
     
  14. razorhazor

    razorhazor Member

    Joined:
    Feb 21, 2004
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    1

    Cheers for that stuart, I needed to reinstall libpng using WHM.

    If i re-intstalled the RPM before step 12 mrtg was able to locate the libpng.so.2 file.
     
  15. stuartj

    stuartj Member

    Joined:
    Jul 17, 2003
    Messages:
    18
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    UK
    Glad it worked out for you.
     
  16. SuperBaby

    SuperBaby Well-Known Member

    Joined:
    Nov 27, 2003
    Messages:
    331
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Thailand
    cPanel Access Level:
    Website Owner
    Twitter:
    (1) I got the errors only twice. No error printed when I started it the third time.

    (2) Initially I got "Page Not Found" when pointing to http://my_IP/mrtg/ . I have to add an alias to httpd.conf and restart httpd before I could see the graphs.

    (cd to the proper directory ....)
    pico httpd.conf
    (add this to the very top of the page ....)
    Alias /mrtg/ /usr/local/apache/htdocs/mrtg/
    (saved the file ....)
    service httpd restart
     
    #16 SuperBaby, Feb 24, 2004
    Last edited: Feb 24, 2004
  17. myusername

    myusername Well-Known Member
    PartnerNOC

    Joined:
    Mar 6, 2003
    Messages:
    691
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    chown -R us.*yourbase*
    cPanel Access Level:
    DataCenter Provider
    Twitter:
    Here's what I get. I skipped step 4 since locate didnt find any file:

    root@mybox [/usr/lib]# cd /usr/lib
    root@mybox [/usr/lib]# locate libpng.so.2.old
    root@mybox [/usr/lib]# mv libpng.so.2 libpng.so.2.OLD
    mv: can't stat source libpng.so.2

    Not sure what that last line meant so I figured I'd stop for a bit.

    Any ideas?
     
  18. Snowman30

    Snowman30 Well-Known Member
    PartnerNOC

    Joined:
    Apr 7, 2002
    Messages:
    681
    Likes Received:
    0
    Trophy Points:
    16
    cPanel Access Level:
    DataCenter Provider
    im getting the same error anyone know how to fix this?
     
  19. RobertOnTheAir

    RobertOnTheAir Active Member

    Joined:
    Aug 2, 2003
    Messages:
    33
    Likes Received:
    0
    Trophy Points:
    6
    I am not an expert in Linux, but I recieved it too. I think it just means the original file was not found. Which is totally fine. I think it was supposed to just make a backup of the file there if it already existed.

    The only problem I had that was not addressed in the ORIGINAL post (but later covered in this thread) was that there was no instructions to include an Alias in the httpd.conf file. I added that per the instructions given and rebooted Apache.

    I now have a nice working copy of MRTG.

    Many thanks for the handy instructions ya'll! :)
     
  20. dory36

    dory36 Well-Known Member

    Joined:
    Aug 30, 2003
    Messages:
    179
    Likes Received:
    0
    Trophy Points:
    16
    Part of mrtg seems to be broken -- below is the error list. I am getting good results except that trying to view mail statistics gives a page not found error.

    Any suggestions?

    Thanks much!

    WARNING: Could not get any data from external command '/etc/mrtg/mailstats'
    Maybe the external command did not even start. (Illegal seek)

    WARNING: Problem with External get '/etc/mrtg/mailstats':
    Expected a Number for 'in' but nothing'

    WARNING: Problem with External get '/etc/mrtg/mailstats':
    Expected a Number for 'out' but nothing'

    ERROR: Target[mail][_IN_] ' $target->[8]{$mode} ' did not eval into defined data
    ERROR: Target[mail][_OUT_] ' $target->[8]{$mode} ' did not eval into defined data
    WARNING: Skipping Update of mail, inlast is not defined
    WARNING: Skipping Update of mail, outlast is not defined
     
Loading...

Share This Page