分类: LINUX
2009-08-28 16:33:38
试验环境:
在一台为监控服务器,192.168.100.210的机器安装Ntop,之前这个机器已
经装过cacti了.
声明:
安装ntop之前要安装libpcap和rrdttool
我这里安装的是ntop-3.3、Libpcap-0.9.8、rrdtool1.2.27
# tar zxvf libpcap-0.9.8.tar.gz
# cd libpcap-0.9.8
#./configure
# make&&make install
gcc -O2 -I. -DHAVE_CONFIG_H -D_U_="__attribute__((unused))" -c ./pcap-linux.c
gcc -O2 -I. -DHAVE_CONFIG_H -D_U_="__attribute__((unused))" -c ./fad-getad.c
In file included from ./fad-getad.c:64:
/usr/include/linux/if_packet.h:52: 错误:expected specifier-qualifier-list before ‘__u32’
make: *** [fad-getad.o] 错误 1
gcc -O2 -I. -DHAVE_CONFIG_H -D_U_="__attribute__((unused))" -c ./fad-getad.c
In file included from ./fad-getad.c:64:
/usr/include/linux/if_packet.h:52: 错误:expected specifier-qualifier-list before ‘__u32’
make: *** [fad-getad.o] 错误 1
在网上找啊找,终于有一篇说明了解决的办法.
将
#include
加入到
/usr/include/linux/if_packet.h
再make&&make install,ok这次再没有出现错误了.
我们到ntop的安装目录,执行下面的命令:
#./autogen.sh
configure: error: Unable to find RRD at /usr/local/rrdtool: please use --with-rrd-home=DIR
它提示找不到rrdtool,让我们用--with-rrd-home指定rrdtool的安装目录,但是奇怪的是我指定了安装路径依旧报错,很是郁闷,为什么呢?在网上查找相关资料,都是没有装rrdtool才导致这个问题的,我于是纳闷了,突然想到是不是版本太久的缘故,于是下了个rrdtool-1.2.27的进行了安装,然后指定相应的路径OK了,哎真没有想到是因为版本的原因,郁闷。。。。。。。。安装rrdtool的过程如下:
#tar -zxvf rrdtool-1.2.27.tar.gz
# cd rrdtool-1.2.27
#./configure --prefix=/usr/local/rrdtool2
# Make&&make install
再到ntop目录下,运行autogen.sh,通过
#./configure --prefix=/usr/local/ntop\
-with-rrd-home=/usr/local/rrdtool2
# Make&& make install
# cp ntop-3.3/packages/RedHat/ntop.conf.sample\
/usr/local/ntop/etc/ntop/ntop.conf
# /usr/local/ntop/bin/ntop -P /usr/local/ntop/share/ntop -u nobody
-A
Mon Mar 31 07:18:53 2008 NOTE: Interface merge enabled by default
Mon Mar 31 07:18:53 2008 Initializing gdbm databases
ntop startup - waiting for user response!
Please enter the password for the admin user:
Password too short (5 characters or more). Please try again.
ntop startup - waiting for user response!
Please enter the password for the admin user: //这里输入密码
Please enter the password again: //再此输入密码
Mon Mar 31 07:19:08 2008 Admin user password has been set
/usr/local/ntop/bin/ntop @/usr/local/ntop/etc/ntop/ntop.conf
-I eth0 -m 192.168.100.0/24
然后输入http:://IP:3000,出现如下的界面: