HOWTO: Compile, configure and run MRTG

I got it running nicely here, thank you for those files :)

Let's see, now you ofcourse would like to know how i did it.
Quity easy; You have to edit the iptraffic-rules file.
Then you must chmod +x it and run it as root.
There you have your iptables entry's :)

Note: Don't forget to edit the mrtg config files :D
 
i am getting this at 1st command:

[root@server1 mrtg-2.10.13]# ./configure --with-gd=/usr/local/lib
checking for gcc... no
checking for cc... no
checking for cc... no
checking for cl... no
configure: error: no acceptable C compiler found in $PATH
See `config.log' for more details.

is there no compiler installed or so?
 
rpm -qa | grep gcc

Do you have gcc listed there..?

If you do, try a configure without the --with-gd=/usr/local/lib

Chris
 
sander815 said:
[root@server1 tmp]# rpm -qa | grep gcc
libgcc-3.2.2-5

If you have a default redhat install it should be listed in the rpms list.. therefore it appears you do not have it, if you are on a desktop you can use the redhat tool and get it from your disks also.

edit: try gcc -v just to confirm its not there..

grab and install the gcc package, all information you need is at: http://gcc.gnu.org/install/

(or you could grab the rpms http://rpmfind.net/linux/rpm2html/search.php?query=gcc)

Chris
 
k, i reinstalled them, now i get this:
checking for gd.h...no

gd lib is installed: gd-1.8.4-11
 
seem slike there is more gd stuff missing:
i get this when i do ./configure

checking for gdImageGif in -lgd... no
checking for gdImagePng in -lgd... no
checking for gdImagePng_jpg in -lgd... no
checking for gdImagePng_jpg_ft in -lgd... no
checking for gdImageGd in -lgd... no
checking gd.h usability... no
checking gd.h presence... no
checking for gd.h... no
checking for gd.h... no

** 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.



[root@server1 mrtg-2.10.13]# rpm -qa | grep gd
gd-1.8.4-11

so it is there
do i have to recomiple it? or reinstall teh rpm?
 
run the command:

locate gd.h

There should be one in the DA templates and one actually being used there somewhere, you could try recompiling apache and make sure you select the rebuild gd option...

Chris
 
some libs were missing, got it installed now..

now i get this:
/usr/local/mrtg-2/bin/mrtg /mypath/to/mrtg/mrtg.cfg
-----------------------------------------------------------------------
ERROR: Mrtg will most likely not work propperly when the environment
variable LANG is set to UTF-8. Please run mrtg in an environment
where this is not the case:

env LANG=C /usr/local/mrtg-2/bin/mrtg ...
-----------------------------------------------------------------------
 
Run:

PHP:
# env LANG=C /usr/local/mrtg-2/bin/mrtg /var/www/html/mrtg/mrtg.cfg

sander815 said:
some libs were missing, got it installed now..

now i get this:
/usr/local/mrtg-2/bin/mrtg /mypath/to/mrtg/mrtg.cfg
-----------------------------------------------------------------------
ERROR: Mrtg will most likely not work propperly when the environment
variable LANG is set to UTF-8. Please run mrtg in an environment
where this is not the case:

env LANG=C /usr/local/mrtg-2/bin/mrtg ...
-----------------------------------------------------------------------
 
Hey guys,

Nearly done installing MRTG... it shows up in my browser etc, but when I run it from the command line, I get:

PHP:
WARNING: Problem with External get '/var/www/html/mrtg/mrtg.sh':
   Expected a Number for 'in' but got ''

WARNING: Problem with Externale get '/var/www/html/mrtg/mrtg.sh':
   Expected a Number for 'out' but got ''

ERROR: Target[index][_IN_] ' $target->[0]{$mode} ' did not eval into defined data
ERROR: Target[index][_OUT_] ' $target->[0]{$mode} ' did not eval into defined data

How to fix?

Thanks,
Matt :)
 
Hi,

The perl files for doing per-IP MRTG are no longer on that site... can someone do a quick how-to and post the files so I can set this up?

Much appreciated,
Matt :)
 
Thankx

Thankx, it's great :)

But now I want that MRTG show the traffic of all the switch ports.
How do I do that?
Does somebody know it?:D
 
i also got my mrtg work now, but i recieved some warning msg at command line:


[root@apple mrtg]# LANG="en_US"
[root@apple mrtg]# /usr/local/mrtg-2/bin/mrtg /var/www/html/mrtg/mrtg.cfg
Rateup WARNING: /usr/local/mrtg-2/bin/rateup could not read the primary log file
for index
Rateup WARNING: /usr/local/mrtg-2/bin/rateup The backup log file for index was i
nvalid as well
Rateup WARNING: /usr/local/mrtg-2/bin/rateup Can't remove index.old updating log
file
Rateup WARNING: /usr/local/mrtg-2/bin/rateup Can't rename index.log to index.old
updating log file
[root@apple mrtg]# cd /var/www/html
[root@apple html]# ls

what's wrong?
 
That's normal first (two) runs, after that all files do exist etc...

edit: if it keeps this way, your chownes or chmods for that directory may be wrong...
 
Back
Top