How install MRTG on linux?

The Multi Router Traffic Grapher (MRTG) is a tool to monitor the traffic load on network links. MRTG generates HTML pages containing PNG images which provide a LIVE visual representation of this traffic.

Here are the steps those I followed :

====
Installing Library zlib :

................
wget http://www.gzip.org/zlib/zlib-1.1.4.tar.gz
tar -xvzf zlib-1.1.4.tar.gz
mv zlib-1.1.4 zlib
cd zlib
./configure
make
cd ..
................

Installing Library libpng :

................
wget http://public.planetmirror.com/pub/sourceforge/l/li/libpng/libpng-1.0.15.tar.gz
tar -xvzf libpng-1.0.15.tar.g
mv libpng-1.0.15 libpng
cd libpng
make -f scripts/makefile.std CC=gcc ZLIBLIB=../zlib ZLIBINC=../zlib
cd ..
................

Installing Library gd :

................
wget http://www.boutell.com/gd/http/gd-1.8.4.tar.gz
tar -xvzf gd-1.8.4.tar.gz
mv gd-1.8.4 gd
cd gd

perl -i~ -p -e s/gd_jpeg.o//g Makefile
make INCLUDEDIRS="-I. -I../zlib -I../libpng" \
LIBDIRS="-L../zlib -L. -L../libpng" \
LIBS="-lgd -lpng -lz -lm" \
CFLAGS="-O -DHAVE_LIBPNG"
cd ..
................

Installing MRTG:

.................
cd /usr/local/src
wget http://oss.oetiker.ch/mrtg/pub/mrtg-2.15.0.tar.gz
gunzip -c mrtg-2.15.0.tar.gz | tar xvf -
cd mrtg-2.15.0
./configure --prefix=/usr/local/mrtg-2 \
--with-gd=/usr/local/src/gd \
--with-z=/usr/local/src/zlib \
--with-png=/usr/local/src/libpng
make
make install
.................

Configuration :-

..................
cd /usr/local/src/mrtg-2.15.0/bin

cfgmaker --global 'WorkDir: /home/yourusername/public_html/mrtg' \
--global 'Options[_]: bits,growright' \
--output /usr/local/mrtg-2/mrtg.cfg \
public@localserver
..................

setup cron :

*/5 * * * * root "env LANG=C /usr/local/mrtg-2/bin/mrtg /usr/local/mrtg-2/mrtg.cfg" --logging /var/log/mrtg.log

View the MRTG :

htpp://localhost/mrtg

No comments:

Post a Comment