HOWTO: Install MRTG (FULLY AUTOMATED)

loopforever said:
I will also update the installer and allow it to take an "update" flag, so that you can simply rerun the installation in "update" mode and it will freshen your MRTG install, and MRTG config. :)

I'm definately looking forward to that :)
 
My friends have on my server domains al0th.info. Why al0th.info/mrtg isn't work?
 
You have to use the server_ip or server hostname to access the stats since mrtg is located in /var/www/html
You can get this working on all domains by adding an alias to the httpd.conf file like squirrelmail and phpmyadmin.
 
installed on freebsd5.3 without error.. but.. http://213.92.118.17/mrtg

someone know what i've missed or what i've to do?

thanks a lot

this is the log:

Update complete!
Adding MRTG to /etc/crontab...
Executing MRTG for the first time (you may see some warnings)...
./install.mrtg.sh: line 64: /usr/local/mrtg-2/bin/mrtg: No such file or directory
If you see warnings above, it is generally safe to ignore.
Cleaning up installation...
Installation of MRTG complete!
 
ok i found the error.. i dont have correctly installed gd library... someone can help me with thos library?

can u say me step by step how install it?

thanks a lot again
 
so, i mixed this script and freebsd ports and now it is installed correctly.. just some error on execution...

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
ERROR: Target[load][_IN_] ' $target->[2]{$mode} ' did not eval into defined data
ERROR: Target[load][_OUT_] ' $target->[2]{$mode} ' did not eval into defined data
ERROR: Target[swap][_IN_] ' $target->[3]{$mode} ' did not eval into defined data
ERROR: Target[swap][_OUT_] ' $target->[3]{$mode} ' did not eval into defined data
ERROR: Target[processes][_IN_] ' $target->[4]{$mode} ' did not eval into defined data
ERROR: Target[processes][_OUT_] ' $target->[4]{$mode} ' did not eval into defined data
ERROR: Target[uptime][_IN_] ' $target->[5]{$mode} ' did not eval into defined data
ERROR: Target[uptime][_OUT_] ' $target->[5]{$mode} ' did not eval into defined data
ERROR: Target[cpu][_IN_] ' $target->[6]{$mode} ' did not eval into defined data
ERROR: Target[cpu][_OUT_] ' $target->[6]{$mode} ' did not eval into defined data
ERROR: Target[memory][_IN_] ' $target->[7]{$mode} ' did not eval into defined data
ERROR: Target[memory][_OUT_] ' $target->[7]{$mode} ' did not eval into defined data


its normal? i've to wait or there is an error somewhere?

thanks again
 
Something is wrong, it should give ya a few errors in the first 10 minutes after installation due to non existant files.

However, these type of errors kinda indicate the script is sending wrong output back or something.

I've got absolutely no experience with FreeBSD, so actually helping you to find out what is wrong can take me quite some time (which I don't really have atm).
 
having troubes

I am having problems installing this.. can someone help me.

Thanks,
Nicholas.


root@sani03 [/]# wget http://serveio.com/da/install.mrtg.sh
--17:33:39-- http://serveio.com/da/install.mrtg.sh
=> `install.mrtg.sh'
Resolving serveio.com... 69.9.34.242
Connecting to serveio.com[69.9.34.242]:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1,987 [application/x-sh]

100%[===================================================================================>] 1,987 --.--K/s

17:33:39 (145.77 MB/s) - `install.mrtg.sh' saved [1,987/1,987]

root@sani03 [/]# chmod +x install.mrtg.sh
root@sani03 [/]# ./install.mrtg.sh
MRTG Installer 1.0 ---------------------
By: Matt Savona (www.serveio.com)
----------------------------------------


Checking for previous MRTG installation...
The directory /var/www/html/mrtg does not exist. I will create it...
mkdir: cannot create directory `/var/www/html/mrtg': No such file or directory
Creating necessary directories and preparing for installation...
mkdir: cannot create directory `/var/www/html/mrtg/core': No such file or directory
chmod: failed to get attributes of `/var/www/html/mrtg/core': No such file or directory
Preparations complete...
Downloading the most recent MRTG and installing it...
--17:33:56-- http://people.ee.ethz.ch/~oetiker/webtools/mrtg/pub/mrtg.tar.gz
=> `mrtg.tar.gz'
Resolving people.ee.ethz.ch... 129.132.2.203
Connecting to people.ee.ethz.ch[129.132.2.203]:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1,135,438 [application/x-tar]

100%[===================================================================================>] 1,135,438 526.78K/s

17:33:59 (525.05 KB/s) - `mrtg.tar.gz' saved [1,135,438/1,135,438]

checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ANSI C... none needed
checking how to run the C preprocessor... gcc -E
checking whether make sets $(MAKE)... yes
checking for a BSD-compatible install... /usr/bin/install -c
checking for perl... /usr/local/bin/perl
checking for groff... /usr/bin/groff
checking for egrep... grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for inttypes.h... (cached) yes
checking for unsigned long long... yes
checking for long long... yes
checking for strtoll... yes
checking for printf long long format specifier... %lld
checking for pow in -lm... yes
checking for gdImageGif in -lgd... yes
checking for gdImagePng in -lgd... yes
checking for gdImagePng_jpg in -lgd... no
checking for gdImagePng_jpg_ft in -lgd... no
checking for gdImageGd in -lgd... yes
checking gd.h usability... yes
checking gd.h presence... yes
checking for gd.h... yes
checking the weather... (cached) it's fine
checking if we can use GCC-specific compiler options... yes
configure: creating ./config.status
config.status: creating Makefile
config.status: creating config.h
ordering CD from http://people.ee.ethz.ch/~oetiker/wish .... just kidding ;-)

----------------------------------------------------------------
Config is DONE!

Type 'make' to compile the software

... that wishlist mentioned above does really exist. So if
you feel like showing your appreciation for MRTG, this is the
place to go. I just love CDs and DVDs

-- Tobi Oetiker <[email protected]>
----------------------------------------------------------------
gcc -I/usr/local/lib -DGFORM_GD=gdImagePng -g -O2 -Wall -Wpointer-arith -Wcast-align -Wmissing-declarations -Wnested-externs -Winline -W -DHAVE_CONFIG_H -c ./src/rateup.c -o bin/rateup.o
LD_RUN_PATH=/usr/local/lib gcc bin/rateup.o -o bin/rateup -L/usr/local/lib -Wl,-Bstatic -lgd -lpng -lz -Wl,-Bdynamic -lm
/usr/local/bin/perl -0777 -p -i~ -e 's@^#!\s*/\S*perl@#! /usr/local/bin/perl@' ./bin/cfgmaker ./bin/indexmaker ./bin/mrtg
/usr/local/bin/perl -0777 -p -i~ -e 's@GRAPHFMT="...";@GRAPHFMT="png";@' ./bin/mrtg ./bin/indexmaker
/bin/sh ./mkinstalldirs /usr/local/mrtg-2/bin
for x in ./bin/mrtg ./bin/cfgmaker ./bin/indexmaker; do \
/usr/bin/install -c -m 755 $x /usr/local/mrtg-2/bin; done
for x in bin/rateup; do \
/usr/bin/install -c -m 755 $x /usr/local/mrtg-2/bin; done
/bin/sh ./mkinstalldirs /usr/local/mrtg-2/lib/mrtg2/Pod
for x in ./lib/mrtg2/*.pm; do \
/usr/bin/install -c -m 644 $x /usr/local/mrtg-2/lib/mrtg2; done
for x in ./lib/mrtg2/Pod/*.pm; do \
/usr/bin/install -c -m 644 $x /usr/local/mrtg-2/lib/mrtg2/Pod; done
/bin/sh ./mkinstalldirs /usr/local/mrtg-2/share/mrtg2/icons
for x in ./images/*.gif ./images/*.png; do \
/usr/bin/install -c -m 644 $x /usr/local/mrtg-2/share/mrtg2/icons; done
/bin/sh ./mkinstalldirs /usr/local/mrtg-2/share/doc/mrtg2
(cd .; for x in COPYING COPYRIGHT README CHANGES THANKS doc/*.pod doc/*.html doc/*.wml doc/*.txt doc/*.png; do \
/usr/bin/install -c -m 644 $x /usr/local/mrtg-2/share/doc/mrtg2; done)
/bin/sh ./mkinstalldirs /usr/local/mrtg-2/man/man1
for x in ./doc/*.1; do \
/usr/bin/install -c -m 644 $x /usr/local/mrtg-2/man/man1; done
MRTG has been installed...
Updating MRTG config and template...
--17:34:10-- http://www.serveio.com/da/mrtgcfg.tar.gz
=> `mrtgcfg.tar.gz'
Resolving www.serveio.com... 69.9.34.242
Connecting to www.serveio.com[69.9.34.242]:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 2,056 [application/x-gzip]

100%[===================================================================================>] 2,056 --.--K/s

17:34:10 (150.83 MB/s) - `mrtgcfg.tar.gz' saved [2,056/2,056]

mv: cannot move `system' to `/var/www/html/mrtg/core': No such file or directory
mv: cannot move `mrtg.cfg' to `/var/www/html/mrtg/core': No such file or directory
Update complete!
Adding MRTG to /etc/crontab...
Executing MRTG for the first time (you may see some warnings)...
ERROR: Creating templock /var/www/html/mrtg/core/mrtg.cfg_l_4203: No such file or directory at /usr/local/mrtg-2/bin/mrtg line 1640.
If you see warnings above, it is generally safe to ignore.
Cleaning up installation...
Installation of MRTG complete!
 
Something is wrong with your permissions.
Don't know what exactly as it looks you are running as root, but you don't have full root permissions somehow (or your drive is full) or something...

Note your installation failed from the get go...
 
I get to work on CentOS 4.1 but it only display the traffic on Ethernet 0 but not the Ethernet 1. How can I make it to show the traffic on both cards.

Thanks

Rocky
 
Last edited:
rocky said:
I get to work on CentOS 4.1 but it only display the traffic on Ethernet 0 but not the Ethernet 1. How can I make it to show the traffic on both cards.

Thanks

Rocky
Not with the standard module, you'll have to edit the config.
Open the config, search for the eth0 thingy, and copypaste it to a section lower, and change (ALL) the values there so they become unique (the name between the [] has to be unique for every section in the config, furthermore you'll only have to edit the eth0 to eth1 in the command thingy (first line or so of section).

If you want eth1 to replace eth0, just open the config, search for the command thingy, and change it to eth1.
(I don't have an example here at the moment, so sorry for this reply being a bit cryptic).
 
FreeBSD 5.3 Problems

Installation said it went ok, but when I go to the serverip/mrtg I only get the core directory, and then forbidden when I click it.

I ran the command that the cronjob was trying to run and got a bunch of errors. They are below. Any ideas on what's wrong?

thanks,
jay

------output-----
WARNING: Problem with External get '/var/www/html/mrtg/core/system network eth0':
Expected a Number for 'in' but got ''

WARNING: Problem with Externale get '/var/www/html/mrtg/core/system network eth0':
Expected a Number for 'out' but got ''

cat: /proc/loadavg: No such file or directory
cat: /proc/loadavg: No such file or directory
WARNING: Problem with External get '/var/www/html/mrtg/core/system load':
Expected a Number for 'in' but got ''

WARNING: Problem with Externale get '/var/www/html/mrtg/core/system load':
Expected a Number for 'out' but got ''

cat: /proc/meminfo: No such file or directory
cat: /proc/meminfo: No such file or directory
expr: syntax error
WARNING: Problem with External get '/var/www/html/mrtg/core/system swap':
Expected a Number for 'in' but got ''

WARNING: Problem with Externale get '/var/www/html/mrtg/core/system swap':
Expected a Number for 'out' but got ''

cat: /proc/loadavg: No such file or directory
cat: /proc/loadavg: No such file or directory
WARNING: Problem with External get '/var/www/html/mrtg/core/system processes':
Expected a Number for 'in' but got ''

WARNING: Problem with Externale get '/var/www/html/mrtg/core/system processes':
Expected a Number for 'out' but got ''

cat: /proc/uptime: No such file or directory
cat: /proc/uptime: No such file or directory
WARNING: Problem with External get '/var/www/html/mrtg/core/system uptime':
Expected a Number for 'in' but got ''

WARNING: Problem with Externale get '/var/www/html/mrtg/core/system uptime':
Expected a Number for 'out' but got ''

cannot open /proc/stat: No such file or directory
WARNING: Could not get any data from external command '/usr/bin/awk '/cpu /{print $2+$3; print $2+$3+$4; print "quite some time"; print "domain.com"}'</proc/stat'
Maybe the external command did not even start. (No such file or directory)

WARNING: Problem with External get '/usr/bin/awk '/cpu /{print $2+$3; print $2+$3+$4; print "quite some time"; print "domain.com"}'</proc/stat':
Expected a Number for 'in' but nothing'

WARNING: Problem with External get '/usr/bin/awk '/cpu /{print $2+$3; print $2+$3+$4; print "quite some time"; print "domain.com"}'</proc/stat':
Expected a Number for 'out' but nothing'

free: not found
free: not found
WARNING: Problem with External get '/var/www/html/mrtg/core/system memory':
Expected a Number for 'in' but got ''

WARNING: Problem with Externale get '/var/www/html/mrtg/core/system memory':
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
ERROR: Can't Execute '/usr/local/mrtg-2/bin/rateup'
 
loopforever said:
You have the old version. The new version will be released in about a week. This new version will included Icheb's new monitoring scripts. I will also update the installer and allow it to take an "update" flag, so that you can simply rerun the installation in "update" mode and it will freshen your MRTG install, and MRTG config. :)

Is the new version work ? ^^
 
Back
Top