1、从网上下载了NTOP3.3,解压缩直接安装 (./autogen.sh --prefix=/usr/local/ntop3 --disable-ipv6)会报如下错误:
Test the compiler and setup CFLAGS...
checking if compiler accepts -W (warning flags)... yes
Critical library/include tests...
checking for pcap_lookupdev in -lpcap... no
*** FATAL ERROR ***
It looks that you don't have the libpcap distribution installed.
Download, compile and, optionally, install it.
When finished please re-run this program.
You can download the latest source tarball at
configure: error: The LBL Packet Capture Library, libpcap, was not found!
[root@testggv ntop-3.3]#
安装LIBpcp 时遇到的问题:
checking if sockaddr_storage struct exists... yes
checking if dl_hp_ppa_info_t struct has dl_module_id_1 member... no
checking if unaligned accesses fail... no
checking for a BSD-compatible install... /usr/bin/install -c
configure: creating ./config.status
config.status: creating Makefile
config.status: WARNING: Makefile.in seems to ignore the --datarootdir setting
config.status: creating config.h
[root@testggv libpcap-0.9.8]# make
gcc -O2 -fPIC -I. -DHAVE_CONFIG_H -D_U_="__attribute__((unused))" -c ./pcap-li
nux.c
gcc -O2 -fPIC -I. -DHAVE_CONFIG_H -D_U_="__attribute__((unused))" -c ./fad-get
ad.c
In file included from ./fad-getad.c:67:
/usr/include/linux/if_packet.h:52: error: expected specifier-qualifier-list befo
re 鈥榑_u32鈥
檓ake: *** [fad-getad.o] Error 1
解决:在/usr/include/linux/if_packet.h加入 #include
然后再接着安装ntop,安装好NTOP后,做如下的设置:
1、chown -R nobody.nobody /usr/local/nto/share/ntop
2、/usr/local/ntop/bin/ntop -P /usr/local/ntop/share/ntop -u nobody -A
(说明:-P:指定.db档存放路径 -u:指定service 启动user A 设定管理员与密码,默认都是:admin,第一次启动的时候需要输入,往后启动不需要要输入,默认端口是3000 或/usr/local/ntop/bin/ntop -P /usr/local/ntop/share/ntop -u nobody -m 192.168.92.0/24 只监控192.168.92.0这个网段)
3、拷贝配置文件模板
cp /usr/local/src/ntop-3.3/packages/RedHat/ntop.conf.sample /etc/ntop.conf
注意几个选项:--user nobody
--daemon
--db-file-path /usr/local/ntop/share/ntop
--interface eth0
--no-mac
--m 123.127.71.128
--trace-level 3
--http-server 3000
--disable-schedyield
最后启动的时候,可以这样/usr/local/ntop/bin/ntop @/etc/ntop.conf 呵)
(安装中可能遇到的问题:
1、NTop can't find libntoprepot-3.2.so 解决办法/sbin/ldconfig /usr/local/bin/ntop
在安装rrdtool-1.3.8的时候,报错,提示checking for intltool >= 0.35.0... ./configure: line 16914: intltool-update: command not found
found
configure: error: Your intltool is too old. You need intltool 0.35.0 or later.
在安装intltool-0.40的时候进行./configure时出现如下错误:
checking for XML::Parser... configure: error: XML::Parser perl module is required for intltool
这是由于XML-Parser缺失而造成的,解决方法就是进行安装。
下载XML-Parser,目前版本是: 2.34,对应的文件名为:XML-Parser-2.34.tar.gz
然后按照如下步骤进行安装:
# tar zxvf XML-Parser-2.34.tar.gz
# cd XML-Parser-2.34
# perl Makefile.PL
# make
# make install
然后再安装intltool0.4.0 还有问题,
安装caigo时,提示需要pixman>=0.10 安装好pixman之后,将pixman-1.pc 拷贝至 /usr/lib/pkg-config/,就可以安装
这里把安装的过程简单的写一下,为后人参考,避免少走弯路。
在安装前检查系统是否安装了tcl、pango-devel相关的包
1 2 |
shell#rpm –qa|grep tcl* shell#rpm –qa|grep pango-devel |
在安装rrdtool时需要cairo包的支持,而cairo又需要pkg-config、glib、pixman、pang、freetype、fontconfig包的支持
安装的顺序是:
1. pkg-config
1 2 3 |
shell#./configure --prefix=/usr shell#make shell#make install |
后面5个包采用上面相同的方法安装
2. glib
3. pixman- 0 .13.2.tar.gz
4. freetype-2.1.10.tar.bz2
5. fontconfig-2.4.2.tar.gz
6. cairo-1.6.4.tar.gz
7. pango-1.21.1.tar.bz2
1 2 3 |
shell#./configure --prefix=/usr --enable-cairo shell#make shell#make install |
这里注意,在编译pango的时候使用–enable-cairo 并且确保他能找到cairo的库
若configure时没有找到cairo库,导致没有生成pangocairo库
configure: WARNING:
—————————————————————————-
* I found a copy of pkgconfig, but there is no pangocairo.pc file around.
You may want to set the PKG_CONFIG_PATH variable to point to its
location.
—————————————————————————-
若出现以上错误信息,请用下面的命令查看
shell#ls $PKG_CONFIG_PATH | grep pangocairo.pc
然后shell#find / -name pangocairo.pc
然后shell#export PKG_CONFIG_PATH=上面find的结果
现在安装rrdtool-1.3.6.tar.gz需要的库文件
1.cgilib- 0 .5.tar.gz
1 2 3 4 |
shell#tar xzvf cgilib- 0 .5.tar.gz shell#make shell#cp libcgi.a /usr/lib shell#cp cgi.h /usr/include |
2.libart_lgpl-2.3.17.tar.gz
1 2 3 |
shell#./configure --prefix=/usr shell#make shell#make install |
3.libpng-1.2.10.tar.gz
1 2 3 |
shell#./configure --prefix=/usr shell#make shell#make install |
4.zlib-1.2.3.tar.gz
1 2 3 |
shell#./configure --prefix=/usr shell#make shell#make install |
5.rrdtool-1.3.6.tar.gz
1 2 3 |
shell#./configure --prefix=/usr/local/rrdtool shell#make shell#make install |
至此rrdtool安装成功。
ntop 3.3.10 安装
至少需要以下的包
-bash-3.00# ls -ltr
total 7140
-rw-rw-r-- 1 root root 1032839 Jan 17 2008 pkg-config-0.23.tar.gz
-rw-rw-r-- 1 root root 184912 Jun 4 2008 intltool-0.40.0.tar.gz
-rw-rw-r-- 1 root root 1274475 Apr 1 22:55 m4-1.4.13.tar.gz
-rw-rw-r-- 1 root root 498465 May 15 14:41 libevent-1.4.11-stable.tar.gz
-rw-rw-r-- 1 root root 1021427 May 19 21:47 rrdtool-1.3.8.tar.gz
-rw-r--r-- 1 root root 3235500 Jul 3 11:46 ntop-3.3.10.tar.gz
编译过程中会出现两个错误
编译过程中会出现两个错误
... entos-fedora-linux/
configure: error: cannot find macro directory `m4'
cd /home/root/source/ntop-3.3.10
mkdir m4
解决
gcc -shared .libs/address.o .libs/argv.o .libs/dataFormat.o .libs/fcUtils.o .libs/globals-core.o .libs/hash.o .libs/iface.o .libs/initialize.o .libs/l7.o .libs/leaks.o .libs/ntop.o .libs/pbuf.o .libs/database.o .libs/plugin.o .libs/prefs.o .libs/protocols.o .libs/sessions.o .libs/term.o .libs/util.o .libs/utildl.o .libs/traffic.o .libs/vendor.o .libs/version.o .libs/ntop_darwin.o -Wl,--rpath -Wl,/home/root/source/ntop-3.3.10/GeoIP-1.4.6/libGeoIP/.libs//.libs -Wl,--rpath -Wl,/usr/local/lib -Wl,--rpath -Wl,/usr/local/rrdtool-1.2.23/lib -Wl,--rpath -Wl,/usr/local/lib -Wl,--rpath -Wl,/usr/local/rrdtool-1.2.23/lib -L/home/root/source/ntop-3.3.10/GeoIP-1.4.6/libGeoIP/.libs/ /home/root/source/ntop-3.3.10/GeoIP-1.4.6/libGeoIP/.libs//.libs/libGeoIP.so -L/usr/local/lib -L/opt/local/lib -L/home/root/source/ntop-3.3.10/lua-5.1.4/src -llua -lpthread -lm -lcrypt -lc -lssl -lcrypto /usr/local/lib/libevent.so /usr/lib/libgdbm.so -lz -lpcap -L/usr/local/rrdtool/lib /usr/local/rrdtool-1.2.23/lib/librrd_th.so -Wl,-soname -Wl,libntop-3.3.10.so -o .libs/libntop-3.3.10.so
gcc: /home/root/source/ntop-3.3.10/GeoIP-1.4.6/libGeoIP/.libs//.libs/libGeoIP.so: No such file or directory
make[2]: *** [libntop.la] Error 1
make[2]: Leaving directory `/home/root/source/ntop-3.3.10'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/root/source/ntop-3.3.10'
make: *** [all] Error 2
解决
cd /home/root/source/ntop-3.3.10/GeoIP-1.4.6/libGeoIP/.libs/
ln -s . .libs
运行 ./autogen.sh && make && make install
OK.
参考
... entos-fedora-linux/
cannot stat `etter.finger.os.gz': No such file or
Here is the fix. Change line 314 of the Makefile from:
ETTER_PASSIVE_DOWNLOAD_FROM = ""
to this:
ETTER_PASSIVE_DOWNLOAD_FROM = ""
and then make dnetter will once again work:
[root@wilber ntop]# make dnetter
Preparing
...Deleting prior file, etter.finger.os...
...Downloading new file...
--13:34:48--
=> `etter.finger.os'
Resolving ettercap.cvs.sourceforge.net... 66.35.250.97
Connecting to ettercap.cvs.sourceforge.net|66.35.250.97|:80... connected.
HTTP request sent, awaiting response... 302 Found
Location: /*checkout*/ettercap/ettercap_ng/share/etter.finger.os?revision=HEAD [following]
Warning: wildcards not supported in HTTP.
--13:34:49-- *checkout*/ettercap/ettercap_ng/share/etter.finger.os?revision=HEAD
=> `etter.finger.os'
Connecting to ettercap.cvs.sourceforge.net|66.35.250.97|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/plain]
[ <=> ] 87,090 84.43K/s
13:34:50 (84.24 KB/s) - `etter.finger.os' saved [87090]
gziping downloaded file...
New file lines are: 1815
New file is:
-rw-r--r-- 1 root root 18394 Jun 8 13:34 etter.finger.os.gz
[root@wilber ntop]#
Here is the fix. Change line 314 of the Makefile from:
ETTER_PASSIVE_DOWNLOAD_FROM = ""
to this:
ETTER_PASSIVE_DOWNLOAD_FROM = ""
and then make dnetter will once again work:
[root@wilber ntop]# make dnetter
Preparing
...Deleting prior file, etter.finger.os...
...Downloading new file...
--13:34:48--
=> `etter.finger.os'
Resolving ettercap.cvs.sourceforge.net... 66.35.250.97
Connecting to ettercap.cvs.sourceforge.net|66.35.250.97|:80... connected.
HTTP request sent, awaiting response... 302 Found
Location: /*checkout*/ettercap/ettercap_ng/share/etter.finger.os?revision=HEAD [following]
Warning: wildcards not supported in HTTP.
--13:34:49-- *checkout*/ettercap/ettercap_ng/share/etter.finger.os?revision=HEAD
=> `etter.finger.os'
Connecting to ettercap.cvs.sourceforge.net|66.35.250.97|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/plain]
[ <=> ] 87,090 84.43K/s
13:34:50 (84.24 KB/s) - `etter.finger.os' saved [87090]
gziping downloaded file...
New file lines are: 1815
New file is:
-rw-r--r-- 1 root root 18394 Jun 8 13:34 etter.finger.os.gz
在安装ntop4.1.0的时候,碰到这样的错误
/libntop.so: undefined reference to `pthread_mutex_trywrlock'
可以这样来解决
The current version of Ntop in SVN (revision 4372) fails to compile on
some systems due to an unresolved symbol error. This is caused by a typo
in globals-structtypes.h on line 315. It currently reads:
#define pthread_rwlock_trywrlock pthread_mutex_trywrlock
It should read:
#define pthread_rwlock_trywrlock pthread_mutex_trylock
[root@wilber ntop]#