HOWTO: Compile, configure and run MRTG

sander815 said:
any1 got some nice configs?

Most configs are nice if they are what you want...

What are you trying to get a graph of and possibly someone/myself could create it... or may even have it.. :)

Chris
 
i only have the default, and like some others, that i might be able to edit myselkf to my needs, but a few good examples would be nice
 
What do I add where to get the trafic on ALL switch ports?
Now it is counting of 1 domain, but I wich to view the traffic of all the servers on my switch ports
- overview of every switchport
 
odd, mrtg used to work ok, and now all of a sudden i get this:

ERROR: Line 3 (INFO=`grep eth0 /proc/net/dev | tr -s ' ' ' ' | cut -d: -f2`) in CFG file (/home/httpd/....../httpdocs/mrtg/mrtg.sh) does not make sense

what does it mean? nothings really changed
 
interfasys said:
*/5 * * * * /usr/local/mrtg-2/bin/mrtg /path/to/html/folder/mrtg/mrtg.cfg

does not work for me (command works from console though)

Any idea on how to run the script every 5 minutes?

I mean should I use this one instead :
*/5 * * * * root /usr/local/mrtg-2/bin/mrtg /path/to/html/folder/mrtg/mrtg.cfg
?

is this resolved? my cron job also don't work at all.

shoud we add root or not?

edit: it worked after adding root.

Plz update this how to and add "root" in that crontab.
 
Last edited:
i installed mrtg, but the results are by far not ok:

Max In: 7766.0 B/s (0.0%) Average In: 3059.0 B/s (0.0%) Current In: 2864.0 B/s (0.0%)
Max Out: 33.6 kB/s (0.1%) Average Out: 15.2 kB/s (0.1%) Current Out: 15.3 kB/s (0.1%)

that should be like this
Max In: 333.2 kb/s (0.3%) Average In: 108.1 kb/s (0.1%) Current In: 97.5 kb/s (0.1%)
Max Out: 138.7 kb/s (0.1%) Average Out: 61.1 kb/s (0.1%) Current Out: 53.0 kb/s (0.1%)


whats wrong? i used the standard cfg posted here
 
deltaned said:
What do I add where to get the trafic on ALL switch ports?
Now it is counting of 1 domain, but I wich to view the traffic of all the servers on my switch ports
- overview of every switchport

what do you mean? i think its not measuring 1 domain, but total traffic over eth0, or you must have 1 site
 
ret said:
i installed mrtg, but the results are by far not ok:

Max In: 7766.0 B/s (0.0%) Average In: 3059.0 B/s (0.0%) Current In: 2864.0 B/s (0.0%)
Max Out: 33.6 kB/s (0.1%) Average Out: 15.2 kB/s (0.1%) Current Out: 15.3 kB/s (0.1%)

that should be like this
Max In: 333.2 kb/s (0.3%) Average In: 108.1 kb/s (0.1%) Current In: 97.5 kb/s (0.1%)
Max Out: 138.7 kb/s (0.1%) Average Out: 61.1 kb/s (0.1%) Current Out: 53.0 kb/s (0.1%)


whats wrong? i used the standard cfg posted here

woops, the difference between bits and bytes :)

how can i chage my cfg to display bits per second?
 
is it also possible to plot the total data traffic in mb/gb per month?
see image
gb.php
 
Last edited:
can i limit my "traffic analysis for eth0" graph? i want to limit to 200Kb!

my average traffic is 100Kb but due to my offline back, every midnight my traffic is hitting to 1000Kb.

my graph is not very nice due to i barely can see my traffic because of my nightly backup that hit so high traffic.
 
i had an error right at the beginning when I typed this.

tar -zxvh mrtg.tar.gz


I got

tar (child): /dev/sa0: Cannot open: Device not configured
tar (child): Error is not recoverable: exiting now

gzip: stdin: unexpected end of file
tar: Child returned status 2
tar: mrtg.tar.gz: Not found in archive
tar: Error exit delayed from previous errors

what is the problem?
 
I'm not sure what the "h" stands for, but the letter immediately before the file name needs to be an "f".

Jeff
 
Thank you I figured that out a little while ago but ran into more problems.

** Ooops, one of many bad things happened:

a) You don't have the GD library installed.
Get it from http://www.boutell.com, compile it and
use either --with-gd-lib=DIR and --with-gd-inc=DIR to specify
its location. You might also have to use --with-z-inc,
--with-z-lib and --with-png-inc, --with-png-lib for gd
versions 1.6 and higher. Check config.log for more
information on the problem.

b) You have the GD library installed, but not the gd.h
header file. Download the source (see above) and use
--with-gd-inc=DIR to specify where the file can be found.

c) You have the library and the header file installed, but
you also have a shared GD library in the same directory.
Remove the shared library files and/or links (e.g.
libgd.so.2.0.0, libgd.so and libgd.so.2). This is especially
likely if you're using a recent (post 1.8.4) version of GD
and didn't configure it with --disable-shared.

d) You have gd library installed and also it's headers, but you are
missing libpng (and headers) or freetype (and headers)
(mrtg does not use freetype, but if your copy of gd is precompiled
against it, you have to install it ...

Consider following the instructions in doc/mrtg-unix-guide.txt
 
I ran into a similar problem.

First run through step b and make sure thats good to go then when your run the configure command again you basically have to tell it where everything is. For example you might have to use

./configue -with-gd=DIR -with-gd-inc=DIR

Right before it compiles, while its checking for these should give you an idea of which one its messing up on.

Tip: If I recall correctly, the include directory is not where you'd think it would be. just search for the gd include file and use that directory instead.
 
Nothing happens after I type

Code:
tar -zxvh mrtg.tar.gz

and press Enter. It just goes to the next line. (I'm no Linux/SSH expert so I apologize if this is a dumb question.)

Pressing more keys does make the characters appear, and I have to press CTRL+C to get back to the command prompt.

Any ideas?
 
Back
Top