Thursday, June 21, 2007

Install & configure the ipfm & MRTG

IPMF INSTALL
============
http://www.generationip.com/docs/0001/network_IPFM-IP-Flow-METER-Documentation.html
================================================================
./configure --exec-prefix=/usr --prefix= --sysconfdir=/usr/local/etc/ --mandir=/usr/local/man
make
make install
===============
/usr/sbin/ipfm -c /usr/local/ipfm/ipfm.conf -p /usr/local/ipfm/pid/ipfm.pid
cd ..
cp ipacc /etc/init.d/
cd /etc/init.d
chkconfig --level 235 ipacc on
/usr/local/sbin/ipfm -c /usr/local/etc/ipfm.conf -p /usr/local/var/run/ipfm.pid
===================
*****copy the folder etc to linux etc







=========================================
MRTG INSTALL RPM or TAR

If you do not have zlib installed:
wget http://www.gzip.org/zlib/zlib-1.1.4.tar.gz
gunzip -c zlib-*.tar.gz tar xf -
rm zlib-*.tar.gz
mv zlib-* zlib
cd zlib
./configure
make
cd ..


======
If you don't have libpng installed
wget http://public.planetmirror.com/pub/sourceforge/l/li/libpng/libpng-1.0.15.tar.gz
gunzip -c libpng-*.tar.gz tar xf -
rm libpng-*.tar.gz
mv libpng-* libpng
cd libpng
make -f scripts/makefile.std CC=gcc ZLIBLIB=../zlib ZLIBINC=../zlib
rm *.so.* *.so
cd ..


=============
For versions up to 1.8.4, try:
wget http://www.boutell.com/gd/http/gd-1.8.4.tar.gz
gunzip -c gd-*.tar.gz tar xf -
rm gd-*.tar.gz
mv gd-* 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 ..For version starting around 2.0.11, try:

wget http://www.boutell.com/gd/http/gd-2.0.11.tar.gz
gunzip -c gd-2.0.11.tar.gz tar xf -
mv gd-2.0.11 gd
cd gd
env CPPFLAGS="-I../zlib -I../libpng" LDFLAGS="-L../zlib -L../libpng" ./configure --disable-shared --without-freetype --without-jpeg
make
cp .libs/* .


============= MRTG
cd /usr/local/src
gunzip -c mrtg-2.12.1.tar.gz tar xvf -
cd mrtg-2.12.1If all the libraries have been preinstalled on your system you can configure mrtg by doing a simple:
./configure --prefix=/usr/local/mrtg-2Otherwise you may have to give some hints on where to find the various libraries required to compile mrtg:
./configure --prefix=/usr/local/src/mrtg-2 --with-gd=/usr/local/src/mrtg/gd --with-zlib=/usr/local/src/mrtg/zlib --with-png=/usr/local/src/mrtg/libpng
make
make install


================Confiure
cfgmaker --global 'WorkDir: /home/httpd/mrtg' \
--global 'Options[_]: bits,growright' \
--output /home/mrtg/cfg/mrtg.cfg \
community@router.abc.xyz


=============== RunAsDaemon:
Yesto your mrtg configuration file and then creating a startup script in your system startup sequence. Unfortunately, adding startup scripts differs widely amongst different unix systems. The modern ones normally have a directory called /etc/init.d or /etc/rc.d/init.d where you put scripts which starts the process you want to run when the system boots. Further you must create a symbolic link in /etc/rc3.d or /etc/rc.d/rc?.d called S65mrtg (this is just a sample name ... it is just important that it starts with S followed by a two digit number). If you are not sure about this, make sure you consult the documentation of your system to make sure you get this right.


./configure --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql --with-gd=/root/gd --with-libpng=/root/libpng --with-zlib=/root/zlib --with-jpeg=/root/jpeg-6b/



Configure the ipfm

cd /usr/local/src/mrtg/
cd etc/ipfm/
vi ipfm.conf
cp ipfm.conf /usr/local/etc/ipfm.conf
cd /usr/local/etc/
vi ipfm.conf
mkdir -p /var/log/ipfm/subnet/
touch /var/log/ipfm/subnet/localan.log
chmod 777 /var/log/ipfm/subnet/localan.log
vi /var/log/ipfm/subnet/localan.log
cd /usr/local/sre/mrtg/etc/
cd ..
cp /usr/sbin/ipfm /usr/local/sbin/ipfm
cp ipacc /etc/init.d/
cd /etc/init.d/
chmod 777 /etc/init.d/ipacc
chkconfig --level 235 ipacc on
service ipacc start
cd /
cp -r mrtg /etc/
cd /etc/mrtg/
mkdir -p /var/www/html/mrtg/
vi 10.15.cfg
ls
vi 10.15.cfg
vi ipfm_acc_eth0
ls
./ipfm_acc_eth0
chmod 777 *
./ipfm_acc_eth0
vi all-ip-eth0
/usr/bin/mrtg /etc/mrtg/10.15.cfg;
locate mrtg
/usr/local/src/mrtg-2/bin/mrtg /etc/mrtg/10.15.cfg
/usr/local/src/mrtg-2/bin/mrtg /etc/mrtg/10.15.cfg
/usr/local/src/mrtg-2/bin/mrtg /etc/mrtg/10.15.cfg
ls
/usr/local/src/mrtg-2/bin/mrtg /etc/mrtg/10.15.cfg
pgrep httpd
service httpd start
/usr/local/src/mrtg-2/bin/mrtg /etc/mrtg/10.15.cfg
/usr/local/src/mrtg-2/bin/mrtg /etc/mrtg/10.15.cfg
/usr/local/src/mrtg-2/bin/mrtg /etc/mrtg/10.15.cfg
/usr/local/src/mrtg-2/bin/mrtg /etc/mrtg/10.15.cfg
ls
./ipfm_acc_eth0
ping 192.168.10.80 -t l 6550
ping 192.168.10.80 -t -l 6550
ping 192.168.10.80 -t -s 6550
ping 192.168.10.80 -s 6550
ping 192.168.10.80 -s 65500
./ipfm_acc_eth0
./ipfm_acc_eth0
./ipfm_acc_eth0
/usr/local/src/mrtg-2/bin/mrtg /etc/mrtg/10.15.cfg
/usr/local/src/mrtg-2/bin/mrtg /etc/mrtg/10.15.cfg
ls
vi all-ip-eth0
./ipfm_acc_eth0
rubelsbd@yahoo.com

0 comments: