HOWTO: Install MRTG (FULLY AUTOMATED)

I found out that I have extra line in my HTTPD conf file that do the Alias of the folder to the hostname/IP /mrtg that is causing the problem as it actually point to another mrtg file which does not contain the mrtg.cfg.

After which I did a service httpd restart and everythiing is fine now. :)

MRTG ROCKS!
 
CEpeep said:
Working well on CentOS 3.4.

Is there any way I can get it to display my bandwidth in bits instead of bytes though? I tried adding "bits" to the options string in the cfg, but it didn't change anything. It's sort of a pain to have to multiply everything by 8 when I want to figure out how much of my pipe I'm using.

EDIT: I figured it out. Had to add it to the traffic options, not global options.
what to edit?
 
Remove the bits option from your mrtg.cfg file.
Edit mrtg.cfg and find a line similar to:
Options[_]: growright,bits,nopercent

Get rid of the word bits and adjust the maxBytes parameter too.
MaxBytes= 1250000
 
page not found error

I used this script and it worked great! But then I had some server problems and had to restart Apache. Now I can't view the mrtg screens.

The files are all there and they're being updated correctly, but I go to: http://myipaddress/mrtg/ and I get a 404 error "Page cannot be found"

Anybody have any ideas?

Thanks,
rebecca
 
mrtg still not working

I tried rebooting the computer - no luck.

Tried uninstalling and reinstalling MRTG - no luck.

I keep getting a 404 error "Page not found". I am SOOO bummed.
 
fixed!

OK... my friend (who has much more of a clue than I do) figured out that the problem was that one of the technicians at my host modified my httpd.conf file and commented out the following line:

DocumentRoot /var/www/html

he replaced it with the path to my webpage...

So, I set that back to the way it was and MRTG came back.

Happy again, but not very happy with my host!
 
clarification

Just to clarify, in case anybody else has the same problem, the change to httpd.conf was in the section for port 80. (The DocumentRoot line also appeared in another section for port 443 - but the problem was in the section for port 80)
 
mtrg

Just instaled. Installation was fine. Needed to change eth0 to venet0 in cfg file.

I'm on vps and for now I use this comand to se memory status:

Code:
grep oomguarpages /proc/user_beancounters | awk '{s=$2;t=$3;u=$4; {print "VPS Memory Usage\nCurrent Held: " s/256 "MB\nMax Held: " t/256 "MB\nBarrier: "u/256"MB" }}'

as for now mtrg doesn't report correctly memoriy status. How should I change this line:

Code:
if [ "$TYPE" = "memory" ]; then
    INDATA=`free -bt | grep buffers\/cache | awk '{print $3}'`
    OUTDATA=`free -bt | grep buffers\/cache | awk '{print $4}'`

so that I have correct readings?
 
cool

very nice been looking for somethink like this for a long time

does anyone no can this be used on each ip's on my servers would be cool if this could be done :D :D

thanks
 
how to change the path /var/www/html/mrtg

hi all how do i change the path from

/var/www/html/mrtg

to

/home/httpd/vhosts/mydomain.com/httpdocs/mrtg

i think i figured it out.

cheers aron
 
Last edited:
ok i got it all working (apart from memory usuage) on a local server. how (from the local server now) do i connect to different servers via snmp and retreive the graphs.

cheers aron.
 
Ok, it wasnt completely flawless.... but easy enough to fix.

Apparently on Ubuntu the default enviornment for cron doesnt make mrtg happy. I fixed the problem by slightly changing the cron entry:

*/5 * * * * root env LANG=C
/usr/local/mrtg-2/bin/mrtg /var/www/html/mrtg/core/mrtg.cfg

Once I did that (added env LANG=c) everything worked just fine.
 
aron said:
ok i got it all working (apart from memory usuage) on a local server. how (from the local server now) do i connect to different servers via snmp and retreive the graphs.

cheers aron.

I think you'd like cacti instead. It's much more powerful than this and has a control panel to get it to connect to snmp servers.

PS Does anyone know what improvements have been made to this latest version of mrtg? Thanks ;)
 
hi eymbo.

i did end up going the cacti way, and it works great.

cheers aron.
 
Back
Top