HOWTO: Very easy RPM based MRTG installation

ProWebUK

Verified User
Joined
Jun 9, 2003
Messages
2,326
Location
UK
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
 
Last edited:
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
 
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
 
Last edited:
This looks very interesting. Looks like I'll be upgrading my MRTG to night :D
 
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 ;) )?
 
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 said:
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 ?
 
interfasys said:
./configure, make, make uninstall ?

where you typed ./configure to install mrtg first time, type the following:

# cd /src
# make uninstall
 
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. ?
 
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
 
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.
 
My graphs are being generated 0 bytes. It is updating though.

Probably related to what I did here? Can you post the RPM you found?

Help! :p
 
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....
 
Yeah. What RPM are you using for libpng? I think the one I installed doesn't work :)
 
The problem *appears* to be another of the RH9 only problems. Give me 10... im trying to find the RPM's now :)

Chris
 
Back
Top