View Full Version : HOWTO: Very easy RPM based MRTG installation
ProWebUK
11-22-2003, 09:38 AM
Before we go into it, this RPM was made by gpan (cheetaweb.com) and full credit goes out to him for this fantastic script!
log into your server as root and follow the information below.
# represents a command
// represents a comment
Disclaimer: The RPM is installed with no warranty of any kind and neither I, nor the makers of this RPM will take responsibility if it damages you server in any way, shape or form.
This version of MRTG has the following (Yes, a premade CFG is included :D ) :
- Traffic
- Open Connections
- Load Averages
- Swap memory
- Processes
- Uptime & idle time
- CPU Usage
- Memory Usage
Some may not work with DA, although i believe they all should. If you have any problems, comments or suggestions please post them in this thread :)
# mkdir mrtg
# cd mrtg
# wget http://prowebuk.com/files/mrtg/mrtg-2.9.17-4ct.i386.rpm
// if you wish to check the MD5, it is MD5: 013a1ee47032b6b7ab5147ca1960e56f
# rpm -Uvh mrtg-2.9.17-4ct.i386.rpm
// Check that a cron line for mrtg has not been added in /etc/crontab
// you can run MRTG by running the following command:
# service mrtg start
You may recieve errors the first few times you run this, if you wish to remove the errors run the following command until you get a simple message stating it is starting MRTG:
# service mrtg restart
// MRTG Will not run as default when you reboot your server, to fix this do the following:
# pico -w /etc/rc.d/rc.local
// at the bottom of the file add the following line:
/etc/rc.d/init.d/mrtg start
// exit and save by press ctrl & X, press y to save.
// You can now access your mrtg graphs by visiting:
http://SERVER_IP/mrtg/
Enjoy it!
** FIXES ADDED IN POST BELOW **
Chris
ProWebUK
11-22-2003, 10:51 AM
ok, i have just realised DA does not like the mail and mrtg sections so here is the fix:
# pico -w /etc/mrtg/mrtg.cfg
// type ctrl & w to search and enter:
mail
// you should be highlighting the following section:
<br><a href="mail.html">- Mail Usage</a><br><a href="mq.html">- Mqueue Usage</a>
// You need to remove the following:
<br><a href="mail.html">- Mail Usage</a><br><a href="mq.html">- Mqueue Usage</a>
// once thats done type ctrl & w to search again, you need to search for:
mail
(again :D )
delete, from the following section to the bottom of the CFG)
#----------------------------------------
# Mail.cfg: Mailstats plotting with MRTG
#----------------------------------------
// you must also remove the mqueue section below the mail section
// to save the file press ctrl & x, press y to save.
//finally remove the no longer used files:
# rm /etc/mrtg/mqueue
# rm /etc/mrtg/mailstats
Chris
ProWebUK
11-22-2003, 11:10 AM
Someone has reported a missing dependency:
libpng.so.2
You may want try the suggestion provided by john (link 3 posts down :) )
Alternatively, you could *try* to do a fresh install of libpng :)
Chris
l0rdphi1
11-22-2003, 12:12 PM
This looks very interesting. Looks like I'll be upgrading my MRTG to night :D
interfasys
11-22-2003, 01:11 PM
Some of us have installed MRTG manually. Would it be possible to post the cfg and sh files somewhere (or provide instructions to remove the old one ;) )?
ProWebUK
11-22-2003, 01:49 PM
Once logged in as root, go to wherever your mrtg is setup, go into the src directory and run the following command from there:
# make uninstall
from there you should be ok :) just go for your RPM install.
Chris
ProWebUK
11-22-2003, 01:54 PM
Regarding the libpng.so.2 dependency problem you may want to try what John has suggested here: http://www.directadmin.com/forum/showthread.php?s=&threadid=1181
Chris
interfasys
11-22-2003, 03:43 PM
Originally posted by ProWebUK
Once logged in as root, go to wherever your mrtg is setup, go into the src directory and run the following command from there:
# make uninstall
from there you should be ok :) just go for your RPM install.
Chris
No src directory in /usr/local/mrtg-2
Maybe you meant the dir used to install mrtg? But no luck from there either unless I need to type ./configure, make, make uninstall ?
ProWebUK
11-22-2003, 03:50 PM
Originally posted by interfasys
./configure, make, make uninstall ?
where you typed ./configure to install mrtg first time, type the following:
# cd /src
# make uninstall
interfasys
11-22-2003, 04:05 PM
That's what I thought at first, but I got a:
make: *** No rule to make target `uninstall'. Stop.
There is only one file in the src dir : rateup.c
Is it safe to retype ./configure, etc. ?
ProWebUK
11-22-2003, 05:10 PM
hmm in that case I am unsure.....
I suggest you stop your current MRTG and remove any cfgs you currently have to ensure that it doesn't get in the way!
Once you have done that try to install the rpm, i'm hoping it wont do any harm....
Chris
interfasys
11-22-2003, 05:43 PM
Deleted /usr/local/mrtg-2, installed the rpm and I now have nice new graphs ;)
I hate to have fragments from old installs, but I'll take care of that later.
ProWebUK
11-22-2003, 07:21 PM
glad to know its working for you :)
Chris
l0rdphi1
11-22-2003, 07:49 PM
My graphs are being generated 0 bytes. It is updating though.
Probably related to what I did here (http://www.directadmin.com/forum/showthread.php?s=&postid=6446)? Can you post the RPM you found?
Help! :p
ProWebUK
11-22-2003, 07:50 PM
all graphs?!?!
l0rdphi1
11-22-2003, 07:52 PM
http://server1.liquenox.net/mrtg :eek:
ProWebUK
11-22-2003, 07:57 PM
I will put my bet on saying the problem relates to libpng, mainly due to the fact libpng produces the graph, and no graphs have been generated....
l0rdphi1
11-22-2003, 07:59 PM
Yeah. What RPM are you using for libpng? I think the one I installed doesn't work :)
ProWebUK
11-22-2003, 08:01 PM
The problem *appears* to be another of the RH9 only problems. Give me 10... im trying to find the RPM's now :)
Chris
ProWebUK
11-22-2003, 08:03 PM
remove the rpm you installed in the other thread and try this one,
ftp://speakeasy.rpmfind.net/linux/redhat/9/en/os/i386/RedHat/RPMS/libpng-1.2.2-16.i386.rpm
Keep us informed with how it goes :)
Chris
l0rdphi1
11-22-2003, 08:29 PM
Here's what I'm getting:
libpng warning: Application was compiled with png.h from libpng-1.2.2
libpng warning: Application is running with png.c from libpng-1.0.13
gd-png: fatal libpng error: Incompatible libpng version in application and library
..and it won't let me remove libpng due to dependencies on bunches of other applications.
ProWebUK
11-22-2003, 08:32 PM
http://forums.ev1servers.net/showthread.php?s=&threadid=22697&highlight=libpng+warning+Application+was+compiled+with+png.h+from+libpng1.2.2
read the post made by cpanelrcih, then there are soloutions 2 posts below.
Chris
ProWebUK
11-22-2003, 08:34 PM
Note that the soloution is for cpanel, i suggest you ensure you have / can replace your current rpm's before removing :)
Chris
ProWebUK
11-22-2003, 08:35 PM
... just read this also!
Remove every single libpng and then when you reinstall, make sure you DO NOT install the ones with "10" next to them.
you had to install the one with 10 that i thought stood out! lol
l0rdphi1
11-22-2003, 08:46 PM
I'm back to libpng.so.2 is needed by mrtg-2.9.17-4ct again.
When installing gnome-libs it gave me:Failed dependencies:
ORBit is needed by gnome-libs-1.4.1.2.90-32
imlib is needed by gnome-libs-1.4.1.2.90-32
libIIOP.so.0 is needed by gnome-libs-1.4.1.2.90-32
libORBit.so.0 is needed by gnome-libs-1.4.1.2.90-32
libORBitCosNaming.so.0 is needed by gnome-libs-1.4.1.2.90-32
libORBitutil.so.0 is needed by gnome-libs-1.4.1.2.90-32
libgdk_imlib.so.1 is needed by gnome-libs-1.4.1.2.90-32
libpng.so.2 is needed by gnome-libs-1.4.1.2.90-32
so I skiped it.
So.. know where I can get a libpng.so.2 that works with RH9?
ProWebUK
11-22-2003, 08:49 PM
try this link, it appears to be the only link i can find with redhat 9 and libpng.so.2!
http://www2.linuxforum.net/RPM/libpng.so.2.html
l0rdphi1
11-22-2003, 08:56 PM
So http://www2.linuxforum.net/RPM/redhat/updates/7.3/en/os/i386/libpng-1.0.14-0.7x.4.i386.html I suppose?
ProWebUK
11-22-2003, 08:58 PM
I guess so, libpng.so.2 is on the provides list, so if it installs it gives your server what it needs..... now we need to hope :)
Chris
l0rdphi1
11-22-2003, 09:20 PM
Well.. this is not going to work.
How do I get it to stop trying to run every 5 minutes?
l0rdphi1
11-22-2003, 11:52 PM
I gave up completely on this RPM mess and have switched back to the old method. However, I am still using a modified version of the RPM's cfg, which is cool.
http://server1.liquenox.net/mrtg :)
interfasys
11-23-2003, 05:39 AM
Care to zip your cfg and sh files so that we have another way to get the same good looking graphs? ;)
ProWebUK
11-23-2003, 09:23 AM
I believe the RH 7.3 installation is going smooth, have not yet seen any major problems :)
I suggest if you have a MRTG installed from source you just remove all configs and stop MRTG from running, I believe the RPM installs to a different directory to that of the compiled version I made a guide for.
Any problems feel free to post here :)
Chris
ProWebUK
11-23-2003, 09:31 AM
Originally posted by l0rdphi1
Well.. this is not going to work.
How do I get it to stop trying to run every 5 minutes?
to uninstall it completely run the normal rpm -e on there
# rpm -e mrtg
can i ask what the error was with the previous libpng?
Chris
ProWebUK
11-23-2003, 09:38 AM
LordPhi: I checked my RH9 box (which has mrtg running) and its running the following version:
libpng-1.2.2-16
Which can be found here:
http://rpmfind.net/linux/RPM/redhat/9/i386/libpng-1.2.2-16.i386.html
Now, the weird thing is i also have no libpng.so.2 and that RPM does *not* provide it, im thinking MRTG may have been compiled with the libpng built in..... if it has been i will consider making a DA specific RPM which could also save pretty much any work involved to get this working properly :)
Chris
l0rdphi1
11-23-2003, 11:54 AM
My .cfg file and the data generator are loacted here (http://www.l0rdphi1.com/junk/mrtg.tgz).
They are working fine as of this afternoon, since I've fixed them.
However, note that the .cfg file is designed to run in /var/www/html/mrtg; you'll have to modify the the .cfg if you want to run it elsewhere.
interfasys
11-23-2003, 12:15 PM
Clap clap clap!
FarCry
11-23-2003, 02:06 PM
I have no problems on RH 7.3, only RH 8 servers.
Dont have any RH 9 servers....
ProWebUK
11-23-2003, 02:25 PM
What are the problems with RH8?
FarCry
11-23-2003, 02:30 PM
More than my calculator can count...
l0rdphi1
11-23-2003, 02:50 PM
I have a question. On http://server1.liquenox.net/mrtg/cpu.html it is reporting that I am using on average 160.0 %CPU. What does that mean? A bug, or something?
ProWebUK
11-23-2003, 03:06 PM
Originally posted by l0rdphi1
I have a question. On http://server1.liquenox.net/mrtg/cpu.html it is reporting that I am using on average 160.0 %CPU. What does that mean? A bug, or something?
Nothing to worry about, it seems all versions of this rpm (plesk cpanel and ensim) have it. Ii will look into a fix, for now there is no fix listed on its other guides.
Mark: can i ask what the problems were relating to? could you paste some of the errors?
Chris
interfasys
12-21-2003, 11:33 PM
Originally posted by l0rdphi1
My .cfg file and the data generator are loacted here (http://www.l0rdphi1.com/junk/mrtg.tgz).
They are working fine as of this afternoon, since I've fixed them.
When I try to use your files, I get a :
/usr/local/mrtg-2/bin/rateup: error while loading shared libraries: libgd.so.2
I have the file in /usr/local/lib/ and MRTG 2.10.11 did'nt complain when installing. Do you think it's an MRTG problem or a config file problem?
EDIT
Recompiled with indication of where to find the lib and it worked.
DarkMastah
05-24-2004, 09:17 AM
[root@joyce mrtg]# rpm -Uvh mrtg-2.9.17-4ct.i386.rpm
error: Failed dependencies:
libgd.so.1.8 is needed by mrtg-2.9.17-4ct
im running redhat fedora core 2
gd and gd-devel is installed:(
ProWebUK
05-24-2004, 11:05 AM
Originally posted by DarkMastah
[root@joyce mrtg]# rpm -Uvh mrtg-2.9.17-4ct.i386.rpm
error: Failed dependencies:
libgd.so.1.8 is needed by mrtg-2.9.17-4ct
im running redhat fedora core 2
gd and gd-devel is installed:(
The gd library must be a different version with fc2 - either follow the source guide or you'll need to wait until i can get some rpms built up myself.
Chris
Thafusion
05-24-2004, 02:57 PM
This is for RH but is there also something for Freebsd ?
ProWebUK
05-24-2004, 03:03 PM
Compile it - theres a thread right below this 1 I believe ;)
Chris
etegration
05-29-2004, 12:45 PM
edit - solved
Have you checked if the Core 1 packages work for you. If not I'll release some FC2 packages.
neorder
06-03-2004, 12:21 PM
Originally posted by l0rdphi1
My .cfg file and the data generator are loacted here (http://www.l0rdphi1.com/junk/mrtg.tgz).
They are working fine as of this afternoon, since I've fixed them.
However, note that the .cfg file is designed to run in /var/www/html/mrtg; you'll have to modify the the .cfg if you want to run it elsewhere.
|0rdphi1
i downloaded your configuration file, there are two files inside.
one is called "system", the other is "mrtg.cnf"
my question is where to put that "system" file? and how come my mrtg looked so plain and simple, but yours looks much nicer?
http://65.75.183.160/mrtg/
http://server1.liquenox.net/mrtg/cpu.html
how do i make something like yours :confused:
thanks.
etegration
06-06-2004, 11:57 PM
Originally posted by gpan
Have you checked if the Core 1 packages work for you. If not I'll release some FC2 packages.
huh?
l0rdphi1
06-07-2004, 09:50 AM
Originally posted by neorder
|0rdphi1
i downloaded your configuration file, there are two files inside.
one is called "system", the other is "mrtg.cnf"
my question is where to put that "system" file? and how come my mrtg looked so plain and simple, but yours looks much nicer?
http://65.75.183.160/mrtg/
http://server1.liquenox.net/mrtg/cpu.html
how do i make something like yours :confused:
thanks. Hello,
You should be able to extract the whole thing to /var/www/html/mrtg, and then just tell mrtg to use the .cfg file.
MRTG will then show up at http://serverIP/mrtg or http://hostname/mrtg
Phi1.
etegration
06-08-2004, 08:41 AM
Originally posted by l0rdphi1
Hello,
You should be able to extract the whole thing to /var/www/html/mrtg, and then just tell mrtg to use the .cfg file.
MRTG will then show up at http://serverIP/mrtg or http://hostname/mrtg
Phi1.
lord, can help me with my MRTG? my errors are a few posts up. :(
etegration
06-09-2004, 11:49 AM
Originally posted by etegration
lord, can help me with my MRTG? my errors are a few posts up. :(
edit - solved.
l0rdphi1
06-09-2004, 02:42 PM
Good hear you got it fixed :)
Phi1.
garyhui
11-13-2004, 10:24 AM
i cannot download the mrtg rpm package.
would you mind post the link again ?
matrixx
01-16-2005, 02:04 AM
Hi ,
The link Chris posted no longer works...
Does anybody have a copy of the RPM please?
Thanks,
Rob
jlasman
01-18-2005, 11:22 PM
Surely someone downloaded this while it was available and still has it?
Thanks.
Jeff
Auraka
01-30-2005, 09:35 AM
Guess this is dead now?
snaaps
02-05-2005, 06:46 AM
Yes its dead!
Is there somewhere a mirror of this script?
Please tell me!
info@ccchosting.nl
jlasman
02-05-2005, 07:02 AM
If anyone has it please let me know and I'll post it in my downloads section so anyone can get it.
Thanks.
Jeff
drmike
03-12-2005, 09:55 AM
http://download.cheetaweb.com/redhat/7.3/mrtg/mrtg-2.9.17-4ct.i386.rpm
Looks like he cleaned up a bit.
-drmike
vBulletin® v3.7.0, Copyright ©2000-2008, Jelsoft Enterprises Ltd.