Friday, April 15, 2011

NTOP + RRD

Install RRDTool First
RRD is the Acronym for Round Robin Database. RRD is a system to store and display time-series data (i.e. network bandwidth, machine-room temperature, server load average). It stores the data in a very compact way that will not expand over time, and it presents useful graphs by processing the data to enforce a certain data density. It can be used either via simple wrapper scripts (from shell or Perl) or via frontends that poll network devices and put a friendly user interface on it.

Installing RRDTool on RHEL/Centos 5.x

In order to install RRDTool on Red Hat Enterprise Linux / CentOS Linux 64 bit version you need to install few development tools and libraries.

Install required dependencies
yum install cairo-devel.x86_64 libxml2-devel.x86_64 pango-devel.x86_64 pango.x86_64 libpng-devel.x86_64 freetype.x86_64 freetype-devel.x86_64 libart_lgpl-devel.x86_64

Download latest rrdtool tar ball
cd /opt/
wget http://oss.oetiker.ch/rrdtool/pub/rrdtool-1.3.8.tar.gz

Step #3: Compile and install rrdtool

You need to set PKG_CONFIG_PATH, enter:
export PKG_CONFIG_PATH=/usr/lib/pkgconfig/

./configure
make
make install
cd /usr/local/
ln -s rrdtool-1.3.8 rrdtool
cd rrdtool
ls -l

How do I verify my installation?

Now RRDtool is installed and ready to use. You can go to /usr/local/rrdtool/share/rrdtool/examples/ directory and run them to see if your installation has been successful or not:

cd /usr/local/rrdtool/share/rrdtool/examples/
./stripes.pl ( if u get font error then install this package yum install dejavu-lgc-fonts.noarch)
ls -l
cp stripes.png /var/www/html/
http://xyz.com/stripes.png

Now Install ntop on Red Hat Enterprise Linux / CentOS Linux

Ntop is a network and traffic analyzer that provides a wealth of information on various networking hosts and protocols. ntop is primarily accessed via a built-in web interface.

yum install libtool.x86_64 automake.x86_64 autoconf.x86_64 gdbm-devel.x86_64 libpcap-devel.x86_64 libpcap.x86_64
wget http://downloads.sourceforge.net/project/ntop/ntop/ntop-3.3.10/ntop-3.3.10.tar.gz?use_mirror=biznetnetworks (or) http://freshmeat.net/projects/ntop/

tar zxvf ntop-3.3.10.tar.gz
mkdir m4
cd ntop-3.3.10
./autogen.sh
make
make install

Setup ntop user admin password
ntop -A

chmod -R 777 /usr/local/var/
mkdir -p /usr/local/var/ntop/rrd
mkdir -p /usr/local/var/ntop/rrd/graphics
mkdir -p /usr/local/var/ntop/rrd/flows

Start ntop
/usr/local/bin/ntop -i "eth0,eth1" -d -L -u ntop -P /usr/local/var/ntop --skip-version-check --use-syslog=daemon

If u get some RRD directory error, create a directory in that location & restart ntop again

http://localhost:3000 access your ntop through GUI..

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

Enjoy .......

No comments: