Qomo Linux 3.1 安装配置ntop 5.1 (正直播中)
今天没事,用下qomo 3.1 ,使用Firefox 自动更新,发现下载速度很慢。
4M 宽带,这么慢。
没事想抓包,看下网络信息,就想到安装个ntop。
不知道能否安装。
下面是安装配置说明:
如果是红旗 Linux SP3系统,只需要安装python 3.3就可以了。
首先,到官网下载 ntop-5.1安装包,
再安装ntop所需要的软件包.
root@yupan ~ pts2 # yum install libpcap libpcap-devel
root@yupan ~ pts2 # yum install libpng gd gd-devel gdbm gdbm-devel zlib zlib-devel
root@yupan ~ pts2 # yum install rrdtool
然后进入 ntop解压包目录。
执行安装:
root@yupan /opt/ntop-5.0.1 pts3 # ./autogen.sh --with-tcpwrap
Starting ntop automatic configuration system v.0.2.3
Please be patient, there is a lot to do...
1. Testing gnu tools....
You must have libtool installed to compile ntop.
Download the appropriate package for your distribution, or get the
source tarball from ftp://ftp.gnu.org/pub/gnu/libtool
We require version 1.4 or higher
We recommend version 1.5 or higher
提示报错,需要安装 libtool
使用yum 安装libtool
root@yupan ~ pts2 # yum install libtool
重装执行安装:
root@yupan /opt/ntop-5.0.1 pts3 # ./autogen.sh --with-tcpwrap
还有报错提示:
checking net/ethernet.h presence... yes
checking for net/ethernet.h... yes
checking for zlibVersion in -lz... yes
checking for main in -lrrd_th... no
configure: error: Unable to find RRD at /usr/local: please use --with-rrd-home=DIR
看来是找不到rrdtool的安装目录不对。
使用yum 安装rrdtool 始终找不到 rrd软件的安装目录,算了,直接编译安装rrdtool吧。
下载rrdtool软件包。我这里下载rrdtool 1.4.7 最新版,
http://oss.oetiker.ch/rrdtool/pub/rrdtool-1.4.7.tar.gz
以下方法安装rrdtool-1.4.7软件包.
root@yupan /opt pts2 # tar -zxvf rrdtool-1.4.7.tar.gz
root@yupan /opt/rrdtool-1.4.7 pts2 # ./configure --prefix=/usr/rrdtool
root@yupan /opt/rrdtool-1.4.7 pts2 # make
grep: /usr/lib/libexpat.la: No such file or directorysed: /usr/lib/libexpat.la: No such file or directorylibtool: link: `/usr/lib/libexpat.la' is not a valid libtool archive
这里提示少expat软件包.
# yum install expat*
安装所有与expat有关的软件,
然后 再重新 安装rrdtool软件包。
还是报错。如下,我晕:
0.0
Can't locate ExtUtils/MakeMaker.pm in @INC (@INC contains: /usr/lib/perl5/5.10.0/i386-linux-thread-multi /usr/lib/perl5/5.10.0
/usr/local/lib/perl5/site_perl/5.10.0/i386-linux-thread-multi /usr/local/lib/perl5/site_perl/5.10.0 /usr/lib/perl5/vendor_perl/5.10.0/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.10.0 /usr/lib/perl5/vendor_perl /usr/local/lib/perl5/site_perl .) at Makefile.PL line 1.
BEGIN failed--compilation aborted at Makefile.PL line 1.
make[3]: *** [perl-piped/Makefile] 错误 2
make[3]: Leaving directory `/opt/rrdtool-1.4.7/bindings'
make[2]: *** [all-recursive] 错误 1
make[2]: Leaving directory `/opt/rrdtool-1.4.7/bindings'
make[1]: *** [all-recursive] 错误 1
make[1]: Leaving directory `/opt/rrdtool-1.4.7'
这与perl软件包有关,需要安装 perl-devel软件包。
#:yum -y install perl*
安装所有包吧。简单。就是下的软件包多。
再次安装 rrdtool ,终于成功了。
root@yupan /opt/rrdtool-1.4.7 pts2 # ./configure --prefix=/usr/rrdtool
root@yupan /opt/rrdtool-1.4.7 pts2 # make
root@yupan /opt/rrdtool-1.4.7 pts2 # make install
然后 再次安装 ntop,又杯具了。
提示 python 版本太老。
Checking python version... Old python installed
那就下载最新python-3.3软件包吧。
安装python-3.3
# ./configure --prefix=/usr/local/python3.3
# make
# make install
#mv /usr/bin/python /usr/bin/python-2.7.bak #备份旧版本的Python
#ln -s /usr/local/bin/python3.2 /usr/bin/python #连接到最新安装的版本目录
#python -V #查看Python版本
这个软件,安装真慢呀。慢慢等 吧。
好在顺利安装成功。
再次安装 ntop。又提示没有安装 geoip软件包.
Removing dups and misplaced entries from LIBS and INCS...
checking for GeoIP_record_by_ipnum in -lGeoIP... no
checking for GeoIP_name_by_ipnum_v6 in -lGeoIP... no
Please install GeoIP (http://www.maxmind.com/)
使用 yum install geoip geoip-devel 来安装软件包。
执行安装ntop-5.0.1 软件包:
root@yupan /opt/ntop-5.0.1 pts3 # ./autogen.sh --with-tcpwrap --with-rrd-home=/usr/rrdtool
root@yupan /opt/ntop-5.0.1 pts3 #make
root@yupan /opt/ntop-5.0.1 pts3 #make install
#make install-data-as
创建ntop用户
#useradd -M -s /sbin/nologin -r ntop
设置目录的权限
# chown ntop:root /usr/local/var/ntop/
# chown ntop:ntop /usr/local/share/ntop/
设置你的NTOP用户管理员密码
#ntop -A
最后启动ntop
/usr/local/bin/ntop -i "eth0,eth2" -d -L -u ntop //可以加多块网块
或者
/usr/local/bin/ntop -i "eth1" -d -L -u ntop -P /usr/local/var/ntop --skip-version-check --use-syslog=daemon
说明:* -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.
设定自启动:vi /etc/rc.local/usr/local/bin/ntop -i "eth1" -d -L -u ntop
访问ntop网站:http://127.0.0.1:3000
最后放个图片,以示真实。
目录 返回
首页