红联Linux门户
Linux帮助

ntop安装过程

发布时间:2008-03-04 21:26:21来源:红联作者:OnlyGE
ntop监控linux系统网络状态
监控网络状态一般都用mrtg这个工具,今天问cooler 那个比较说,他说ntop,我也就拿来试试,中间遇到了N多麻烦.都是破软件包之间的依赖.低版本与高版本的问题.还好解决了

一、NTOP的功能
NTOP主要提供以下一些功能:
自动从网络中识别有用的信息;
将截获的数据包转换成易于识别的格式;
对网络环境中通信失败的情况进行分析;
探测网络环境中的通信瓶颈;
记录网络通信的时间和过程。
它可以通过分析网络流量来确定网络上存在的各种问题;也可以用来判断是否有黑客正在攻击网络系统;还可以很方便地显示出特定的网络协议、占用大量带宽的 主机、各次通信的目标主机、数据包的发送时间、传递数据包的延时等详细信息。通过了解这些信息,网管员可以对故障做出及时的响应,对网络进行相应的优化调整,以保证网络运行的效率和安全。

二 我的环境
Os : rhel 5
Kernel: 2.6.15
已安装好:apache2.2.6+php5.2.4+gd (freetype +zlib+jpeg+libpng+libxml2)
这些软件的安装看我以前的文章:

三 软件包下载地址及依赖
Ntop3.3 : http://jaist.dl.sourceforge.net/sourceforge/ntop/ntop-3.3.tar.gz
Libpcap : ftp://ftp.pld-linux.org/dists/2.0/PLD/i686/PLD/RPMS/libpcap-devel-0.9.4-1.i686.rpm
ftp://ftp.pld-linux.org/dists/2.0/PLD/i686/PLD/RPMS/libpcap-0.9.4-1.i686.rpm
安装 : rpm -Uvh …….
Rrdtool : ftp://ftp.pucpr.br/rrdtool/rrdtool-1.2.9.tar.gz
Cgilib: http://www.infodrom.org/projects/cgilib/download/cgilib-0.5.tar.gz
Ntop 3.3 需要: apache rrdtool-1.2以上 libpcap
Rrdtool 需要: cgilib freetype 等,如果你装了我以上所说的包就没事.要不就缺什么装什么

注: rrdtool 1.2 以上的版本不带有cgilib zlib 所以需要手动安装
Rrdtool 1.2 以上还需要cgilib 5 的版本.请注意

四: 安装软件

Cgilib
# tar zxvf cgilib-0.5.tar.gz
# cd cgilib-0.5
# make
# cp libcgi.a /usr/lib
# cp cgi.h /usr/include

Rrdtool
# tar zxvf rrdtool-1.2.9.tar.gz
# cd rrdtool-1.2.9
# ./configure -prefix=/usr/local/rrdtool
# make;make install

Ntop
# tar zxvf ntop-3.3.tar.gz
# cd ntop-3.3
# ./configure -prefix=/usr/local/ntop
# make; make install
# cp packages/RedHat/ntop.conf.sample /etc/ntop.conf

五 配置ntop
# groupadd ntop
# useradd ntop -g ntop
# mkdir /var/log/ntop //新建日志存放路径
# chown -R ntop.ntop /usr/local/ntop/share/ntop
# chown -R ntop.ntop /var/log/ntop
# cd /usr/local/ntop/bin
#./ntop -A //设置密码
# ntop -P /var/log/ntop/ -u nobody & //启动服务

//-P [directory]指定.db档存放路径
//-u [user]指定service启动user

设置开机自动启动:
# echo "ntop -p /var/log/ntop & 2>1 1> /dev/null" >> /etc/rc.d/rc.local

配置完成.
IP输入: http:// ip : 3000 就OK 了.
文章评论

共有 2 条评论

  1. comes 于 2008-03-04 23:39:57发表:

    ntop-3.3/utils/config_h1.awk
    ntop-3.3/utils/config_h2.awk
    ntop-3.3/utils/faqtohtml.awk
    ntop-3.3/utils/inetnum2countryalloc.c
    ntop-3.3/utils/init.d_ntop
    ntop-3.3/utils/insertssi.awk
    ntop-3.3/utils/Juniper/
    ntop-3.3/utils/Juniper/juniper.conf.sample
    ntop-3.3/utils/Juniper/README
    ntop-3.3/utils/Juniper/setFilter.pl
    ntop-3.3/utils/linuxrelease
    ntop-3.3/utils/lookuptest.c
    ntop-3.3/utils/Makefile
    ntop-3.3/utils/p2c
    ntop-3.3/utils/p2clib.c
    ntop-3.3/utils/p2clib.h
    ntop-3.3/utils/prefixtablegen.c
    ntop-3.3/utils/processstruct.awk
    ntop-3.3/utils/README
    ntop-3.3/utils/rm.bat
    ntop-3.3/utils/rrd-alarm/
    ntop-3.3/utils/rrd-alarm/conf/
    ntop-3.3/utils/rrd-alarm/conf/alarm.conf.example
    ntop-3.3/utils/rrd-alarm/doc/
    ntop-3.3/utils/rrd-alarm/doc/rrd.pdf
    ntop-3.3/utils/rrd-alarm/Makefile
    ntop-3.3/utils/rrd-alarm/README
    ntop-3.3/utils/rrd-alarm/rrd_alarm.c
    ntop-3.3/utils/sampleMACfile.txt
    ntop-3.3/utils/verified.awk
    ntop-3.3/utils/xmldump.awk
    ntop-3.3/vendor.c
    ntop-3.3/vt.sed
    ntop-3.3/webInterface.c
    ntop-3.3/www/
    ntop-3.3/www/FILES
    ntop-3.3/www/Perl/
    ntop-3.3/www/Perl/dumpFlat.pl
    ntop-3.3/www/Perl/mapper.pl
    ntop-3.3/www/Perl/nClient
    ntop-3.3/www/Perl/remoteClient.pl
    ntop-3.3/www/PHP/
    ntop-3.3/www/PHP/doSearch.php
    ntop-3.3/www/PHP/ifStats.php
    ntop-3.3/www/PHP/index.html
    ntop-3.3/www/PHP/sessions.php
    ntop-3.3/www/Python/
    ntop-3.3/www/Python/ntopTest.py
    ntop-3.3/www/README
    [root@localhost soft]# ls
    cdrom download.php?id=174.1 phpmyadmin.tar.gz
    cgilib-0.5 index.html rrdtool-1.2.9
    cgilib-0.5.tar ntop-3.3 rrdtool-1.2.9.tar
    download.php?id=174 ntop-3.3.tar webmin-1.350-1.noarch.rpm
    [root@localhost soft]# c ntop-3.3
    -bash: c: command not found
    [root@localhost soft]# cd ntop-3.3
    [root@localhost ntop-3.3]# ls
    acinclude.m4 etter.finger.os.gz leaks.h plugin.c
    acinclude.m4.in fcReport.c libtool.m4.in plugins
    acinclude.m4.ntop fcUtils.c ltmain.sh pluginSkeleton.c
    aclocal.m4 fcUtils.h main.c PORTING
    address.c getopt1.c Makefile.am prefs.c
    admin.c getopt.c Makefile.mingw protocols.c
    argv.c getopt.h MANIFESTO README
    AS-list.txt.gz globals-core.c missing report.c
    AUTHORS globals-core.h mkinstalldirs reportUtils.c
    autogen.sh globals-defines.h NetFlow scsiUtils.h
    autotoolversions globals-report.c NEWS sessions.c
    ChangeLog globals-report.h ntop.8 specialMAC.txt.gz
    compile globals-structtypes.h ntop.c ssl.c
    config.guess graph.c ntop-cert.pem stamp-h.in
    config.h.in hash.c ntop-config.in SUPPORT_NTOP.txt
    config.sub html ntop_darwin.c term.c
    configureextra http.c ntop_darwin.h THANKS
    configure.in iface.c ntop.h traffic.c
    CONTENTS iface.h ntop.html util.c
    COPYING initialize.c ntop.txt utildl.c
    database.c INSTALL ntop_win32.c utils
    dataFormat.c installer ntop_win32.h vendor.c
    depcomp install-sh oui.txt.gz vt.sed
    dirent.c l7.c p2c.opt.table.gz webInterface.c
    docs l7-patterns packages www
    emitter.c leaks.c pbuf.c
    [root@localhost ntop-3.3]# ./configure - prefix=/usr/local/ntop
    -bash: ./configure: 没有那个文件或目录
    [root@localhost ntop-3.3]# cd ..
    [root@localhost soft]# cd cd rrdtool-1.2.9
    -bash: cd: cd: 没有那个文件或目录
    [root@localhost soft]# cd cd rrdtool-1.2.9
    -bash: cd: cd: 没有那个文件或目录
    [root@localhost soft]# ls
    cdrom download.php?id=174.1 phpmyadmin.tar.gz
    cgilib-0.5 index.html rrdtool-1.2.9
    cgilib-0.5.tar ntop-3.3 rrdtool-1.2.9.tar
    download.php?id=174 ntop-3.3.tar webmin-1.350-1.noarch.rpm
    [root@localhost soft]# cd rrdtool-1.2.9
    [root@localhost rrdtool-1.2.9]# ls
    acinclude.m4 config.h.in COPYING libtool NT-BUILD-TIPS.txt
    aclocal.m4 config.log COPYRIGHT ltmain.sh README
    bindings config.sub depcomp Makefile.am rrdtool.spec
    CHANGES configure doc Makefile.in src
    compile configure.ac examples missing THREADS
    config.guess CONTRIBUTORS install-sh NEWS TODO
    [root@localhost rrdtool-1.2.9]# ./configure - prefix=/usr/local/rrdtool
    configure: error: unrecognized option: -
    Try `./configure --help' for more information.
    [root@localhost rrdtool-1.2.9]#

  2. comes 于 2008-03-04 23:24:14发表:

    请问楼主 请看看那的配置遇到的问题
    [root@localhost ntop-3.3]# cd ntop
    ntop.8 ntop-config.in ntop.h ntop_win32.c
    ntop.c ntop_darwin.c ntop.html ntop_win32.h
    ntop-cert.pem ntop_darwin.h ntop.txt
    [root@localhost ntop-3.3]# cd ntop
    ntop.8 ntop-config.in ntop.h ntop_win32.c
    ntop.c ntop_darwin.c ntop.html ntop_win32.h
    ntop-cert.pem ntop_darwin.h ntop.txt
    [root@localhost ntop-3.3]# ./configure - prefix=/usr/local/ntop
    -bash: ./configure: 没有那个文件或目录
    [root@localhost ntop-3.3]# make
    make: *** 没有指明目标并且找不到 makefile。 停止。
    [root@localhost ntop-3.3]# make
    make: *** 没有指明目标并且找不到 makefile。 停止。
    [root@localhost ntop-3.3]# make install
    make: *** 没有规则可以创建目标“install”。 停止。
    [root@localhost ntop-3.3]# ls
    acinclude.m4 etter.finger.os.gz leaks.h plugin.c
    acinclude.m4.in fcReport.c libtool.m4.in plugins
    acinclude.m4.ntop fcUtils.c ltmain.sh pluginSkeleton.c
    aclocal.m4 fcUtils.h main.c PORTING
    address.c getopt1.c Makefile.am prefs.c
    admin.c getopt.c Makefile.mingw protocols.c
    argv.c getopt.h MANIFESTO README
    AS-list.txt.gz globals-core.c missing report.c
    AUTHORS globals-core.h mkinstalldirs reportUtils.c
    autogen.sh globals-defines.h NetFlow scsiUtils.h
    autotoolversions globals-report.c NEWS sessions.c
    ChangeLog globals-report.h ntop.8 specialMAC.txt.gz
    compile globals-structtypes.h ntop.c ssl.c
    config.guess graph.c ntop-cert.pem stamp-h.in
    config.h.in hash.c ntop-config.in SUPPORT_NTOP.txt
    config.sub html ntop_darwin.c term.c
    configureextra http.c ntop_darwin.h THANKS
    configure.in iface.c ntop.h traffic.c
    CONTENTS iface.h ntop.html util.c
    COPYING initialize.c ntop.txt utildl.c
    database.c INSTALL ntop_win32.c utils
    dataFormat.c installer ntop_win32.h vendor.c
    depcomp install-sh oui.txt.gz vt.sed
    dirent.c l7.c p2c.opt.table.gz webInterface.c
    docs l7-patterns packages www
    emitter.c leaks.c pbuf.c
    [root@localhost ntop-3.3]# install-sh
    -bash: install-sh: command not found
    [root@localhost ntop-3.3]# install
    install: 参数太少

    [root@localhost ntop-3.3]# rpm -qa |grep ntop
    [root@localhost ntop-3.3]# rpm -qa |grep ntop
    [root@localhost ntop-3.3]# rpm -qa |rrdtool
    -bash: rrdtool: command not found
    [root@localhost ntop-3.3]# rpm -qa |grep rrdtool