免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1013 | 回复: 0
打印 上一主题 下一主题

linux下实战ntop监控局域网 [复制链接]

论坛徽章:
2
2015年辞旧岁徽章
日期:2015-03-03 16:54:1515-16赛季CBA联赛之上海
日期:2016-05-05 09:45:14
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2008-04-09 16:42 |只看该作者 |倒序浏览
最近喜欢上编译的感觉,所以下载的都是源码!
下载ntop-3.3
wget
http://downloads.sourceforge.net/ntop/ntop-3.3.tar.gz?modtime=1181433124&big_mirror=0
tar -zxvf ntop-3.3.tar.gz
cd ntop-3.3
./autogen.sh
过不了,,没办法,,没装libpacp,,没话说,下来装吧!
wget
http://www.tcpdump.org/release/libpcap-0.9.8.tar.gz

tar -zxvf libpcap-0.9.8.tar.gz
cd libpcap-0.9.8
ls
./configure
checking for flex... no
checking for bison... no

少了这两个,郁闷,下载再装吧
wget
http://prdownloads.sourceforge.net/flex/flex-2.5.35.tar.gz?download
tar -zxvf flex-2.5.35.tar.gz
cd flex-2.5.35
ls
./configure
make;make install

wget
http://ftp.gnu.org/gnu/bison/bison-2.3.tar.gz
tar -zxvf bison-2.3.tar.gz
cd bison-2.3
ls
./configure
make
make install

安装完成后
vi /etc/ld.so.conf
加入
/usr/local/lib
ldconfig -v

再到libpacp目录,,运行./configure,通过,我的GOD来了,结果一make,又出错,我F..K
[root@localhost libpcap-0.9.8]# 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

到网上找了N久,,终于找到了,,和和,幸运!

#include  
加入到
/usr/include/linux/if_packet.h

再make,make install,,通过!
再回去试一下autogen.sh,,还是少东西也,,,晕呀,,,继续找,libgdm...错误如下:
*******************************************************************
*
* ERROR: gdbm header or library routines are missing
*           (yes means it was found, no means it was not found)
*
*              gdbm.h...no
*              gdbm_open() in -lgdbm...no
*
*>>> No way to proceed.
*
*???     1. Install libgdbm
*???    and Rerun ./configure
*???  or 2. Use the --with-gdbm-xxxxx= options
*
*******************************************************************

configure: error: Unable to continue... aborting ./configure
wget
http://ftp.gnu.org/pub/gnu/gdbm/gdbm-1.8.3.tar.gz
tar -zxvf gdbm-1.8.3.tar.gz
cd gdbm-1.8.3
ls
./configure
make ;make install
再执行autogen.sh,,还是错,,,,信心呀!!!!!错误如下:
configure: error: Unable to find RRD at /usr/local/rrdtool: please use --with-rrd-home=DIR
少RRDTOOL,,汗,,这么这么多包包!下载,无语!
http://oss.oetiker.ch/rrdtool/pub/?M=D
wget
http://oss.oetiker.ch/rrdtool/pub/rrdtool-1.2.27.tar.gz
tar -zxvf rrdtool-1.2.27.tar.gz
cd rrdtool-1.2.27
ls
./configure --prefix=/usr/local/rrdtool
出错,少三个包,,越来越晕了,
wget
http://oss.oetiker.ch/rrdtool/pub/libs/libart_lgpl-2.3.17.tar.gz
wget
http://oss.oetiker.ch/rrdtool/pub/libs/freetype-2.3.5.tar.gz
wget
http://oss.oetiker.ch/rrdtool/pub/libs/libpng-1.2.18.tar.gz
tar -zxvf libart_lgpl-2.3.17.tar.gz
cd libart_lgpl-2.3.17
./configure
make;make install
cd
tar -zxvf freetype-2.3.5.tar.gz
cd freetype-2.3.5
./configure
make ;make install
cd
tar -zxvf libpng-1.2.18.tar.gz
libpng-1.2.18
./configure
make ;make install
安装完后,继续安装rrdtool,,,不过在测试是还是没通过,,郁闷了,还是那三个包,后来发现包安装的位置不同,修改:
cd /usr/local/include/
cp -r libart-2.0/ /usr/include/libart-2.0/
cp -r freetype2/ /usr/include/freetype2/
cp -r libpng12/ /usr/include/libpng12/
再安装
./configure --prefix=/usr/local/rrdtool
make;make install
完成,
再到ntop目录下,运行autogen.sh,,,通过!
./configure --prefix=/usr/local/ntop
make;make install
cp ntop-3.3/packages/RedHat/ntop.conf.sample /usr/local/ntop/etc/ntop/ntop.conf
[root@localhost ntop]# /usr/local/ntop/bin/ntop -P /usr/local/ntop/share/ntop -u root -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
[root@localhost ntop]#
再运行
/usr/local/ntop/bin/ntop @/usr/local/ntop/etc/ntop/ntop.conf -m 192.168.1.0/24"
OK了,和和,,,终于好了,和和,足足花了了好几个小时!





本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/249/showart_523791.html
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP