martes, 23 de abril de 2013

Instalar NTOP en CentOS 6

Buscando un buen manual para instalar NTOP en centos me encontre conuno muy bueno solo le hice unas modificaciones ya que al instalarlo medio problemas y detallo la solución realizada.

######Instalamos dependencias necesarias########

yum install cairo-devel libxml2-devel pango-devel pango libpng-devel
yum install freetype freetype-devel libart_lgpl-devel wget gcc make
yum install perl-ExtUtils-MakeMaker

cd /opt
wget http://oss.oetiker.ch/rrdtool/pub/rrdtool-1.4.5.tar.gz
tar -zxvf rrdtool-1.4.5.tar.gz
cd rrdtool-1.4.5
./configure -prefix=/usr/local/rrdtool
make
make install

cd ..
yum install libpcap libpcap-devel gdbm gdbm-devel
yum install libevent libevent-devel
wget http://geolite.maxmind.com/download/geoip/api/c/GeoIP-1.4.8.tar.gz
tar -zxvf GeoIP-1.4.8.tar.gz
cd GeoIP-1.4.8
./configure
make
make install

cd ..
###### Instalamos NTOP#####
yum install libtool automake autoconf
wget http://sourceforge.net/projects/ntop/files/latest/download?source=files
tar zxvf ntop-5.0.1.tar.gz
cd ntop-5.0.1
./autogen.sh -prefix=/usr/local/ntop
make
make install

cd ..
 ####Creamos el usuario Ntop y damos permisos###
useradd -M -s /sbin/nologin -r ntop
chown ntop:root /usr/local/ntop
chown ntop:ntop /usr/local/ntop/share/ntop

###esto es para generar el password ######
/usr/local/ntop/bin/ntop -A

###Para correr la apliccion de ntop en demonio#####
/usr/local/ntop/bin/ntop -d -L -u ntop -P /usr/local/ntop –skip-version-check –use-syslog=daemon

###Para cargar la interfaz####
http://ip-del-servidor:3000/

###Abrir puerto IPTABLES###
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 3000 -j ACCEPT

service iptables restart

###Configurar Ntop con el arranque
vi /etc/rc.local
/usr/local/bin/ntop -i "eth0,eth1" -d -L -u ntop -P /usr/local/var/ntop --skip-version-check --use-syslog=daemon

Detalle de los parametros:
    -i "eth0,eth1" : Specifies the network interface or interfaces to be used by ntop for network monitoring. Here you are monitoring eth0 and eth1.
    -d : Run ntop as a daemon.
    -L : Send all log messages to the system log (/var/log/messages) instead of screen.
    -u ntop : Start ntop as ntop user
    -P /usr/local/var/ntop : Specify where ntop stores database files. You may need to backup database as part of your disaster recovery program.
    --skip-version-check : By default, ntop accesses a remote file to periodically check if the most current version is running. This option disables that check.
    --use-syslog=daemon : Use syslog daemon.

Referencias:
http://ryanwoon.wordpress.com/2011/08/20/install-ntop-in-centos-6/
http://www.cyberciti.biz/faq/howto-install-ntop-on-rhel-centos-fedora-linux/