Install MRTG on RH9 in 10 Easy Steps

asuservice

Well-Known Member
Oct 24, 2001
83
0
306
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!
 

The MAzTER

Well-Known Member
Jul 3, 2003
106
0
166
error: Failed dependencies:
perl >= 5.004 is needed by mrtg-2.9.17-1cpanel
:-/

and cpanel downgraded perl a while ago i think
 

mainarea

Active Member
Nov 18, 2002
41
0
156
Originally posted by The MAzTER
error: Failed dependencies:
perl >= 5.004 is needed by mrtg-2.9.17-1cpanel
:-/

and cpanel downgraded perl a while ago i think
Perl should be over 5.004 on your machine... here's what my RH 9 machine shows:

[email protected] [~]# 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
 

stuartj

Member
Jul 17, 2003
18
0
151
UK
I can also report this is stable with fedora core 1 based o/s servers no issues on 17 machines.

Stuart
 

razorhazor

Member
Feb 21, 2004
10
0
151
getting

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

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

stuartj

Member
Jul 17, 2003
18
0
151
UK
you can remove the file and re add the symbolic link then restart / stop a number of times the error should clear.
 

razorhazor

Member
Feb 21, 2004
10
0
151
Originally posted by stuartj
you can remove the file and re add the symbolic link then restart / stop a number of times the error should clear.
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
 

stuartj

Member
Jul 17, 2003
18
0
151
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
 

razorhazor

Member
Feb 21, 2004
10
0
151
Originally posted by stuartj
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

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.
 

SuperBaby

Well-Known Member
Nov 27, 2003
343
0
166
Thailand
cPanel Access Level
Website Owner
Twitter
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
(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
 
Last edited:

myusername

Well-Known Member
PartnerNOC
Mar 6, 2003
693
1
168
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:

[email protected] [/usr/lib]# cd /usr/lib
[email protected] [/usr/lib]# locate libpng.so.2.old
[email protected] [/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?
 

Snowman30

Well-Known Member
PartnerNOC
Apr 7, 2002
679
0
316
cPanel Access Level
DataCenter Provider
Originally posted by myusername
Here's what I get. I skipped step 4 since locate didnt find any file:

[email protected] [/usr/lib]# cd /usr/lib
[email protected] [/usr/lib]# locate libpng.so.2.old
[email protected] [/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?
im getting the same error anyone know how to fix this?
 

RobertOnTheAir

Active Member
Aug 2, 2003
32
0
156
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! :)
 

dory36

Well-Known Member
Aug 30, 2003
179
0
166
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