#20150205
#环境 Centos6.3 + php + apache2
lastest Version:ntop-5.0.1.tar.gz
downlaod :http://sourceforge.net/projects/ntop/files/ntop/Stable/
homepage :http://www.ntop.org/
查询程序解压缩下的说明 README 获取安装文档
For instructions on how to build ntop from source, see docs/BUILD-NTOP.txt (*nix). #安装文档。
Ntop是一种监控网络流量工具,用ntop显示网络的使用情况比其他一些网络管理软件更加直观、详细。
Ntop甚至可以列出每个节点计算机的网络带宽利用率。他是一个灵活的、功能齐全的,用来监控和解决局域网问题的工具;
尤其当ntop与nprobe配合使用,其功能更加显著。它同时提供命令行输入和web页面,可应用于嵌入式web服务
Ntop功能
Ntop主要提供以下一些功能
自动从网络中识别有用的信息;
将截获的数据包转换成易于识别的格式;
对网络环境中通信失败的情况进行分析;
探测网络通信的时间和过程
http://wenku.baidu.com/view/dbe6102fb4daa58da0114ac0.html #使用指南
ntop is a tool for both Unix and Win32 that shows the network usage, similar to what the popular top Unix command does.
It sports a web interface for accessing accounting data and includes support for popular tools/protocols such as NetFlow/sFlow/RRD.
编译安装
依赖的包:
已安装好:apache2.2.6+php5.2.4+gd
yum install -y m4 glibc glibc-devel gcc cpp librrdtool openssl zlib zlib-devel openssl-devel libpcap libpacp-devel libtool autoconf automake gdbm-devel gdbm zlib-devel ruby GeoIP-devel libpng libxml2 libxml2-devel jpeg freetype
yum –y install pango-devel* cairo-devel*
画图会使用python-mako
yum install python-setuptools
yum install python-mako
依赖包编译安装:
rrdtool-1.4.5.tar.gz
configure报错
configure: error: Please fix the library issues listed above and try again.
yum –y install pango-devel* cairo-devel*
./conference --prefix=/usr/local/rrdtool
make
make install
程序编译安装:
tar zxvf ntop-5.0.1.tar.gz
cd ntop-5.0.1
yum install -y subversion
yum install -y libpcap-devel
yum install -y libtool-devel
yum install -y python python-devel
wget http://geolite.maxmind.com/download/geoip/api/c/GeoIP.tar.gz
./configuer
make
make install
ldconfig
./autogen.sh #解决依赖关系。需要很多包
./configure --prefix=/usr/local/ntop --with-rrd-home=/usr/local/rrdtool/
#########确认返回结果
Install directories:
Default prefix: /usr/local
Install into: /usr/local/ntop (default or via --prefix request)
Data files are in /usr/local/ntop/share/ntop
Config files are in /usr/local/ntop/etc/ntop
Run directory is /usr/local/ntop/var/ntop
Plugin files are in /usr/local/ntop/lib/ntop/plugins
Database files are in /usr/local/ntop/var/ntop
#########
make
make install
************************************************************
************************************************************
WARNING: This install created a directory for the ntop
files and databases:
/usr/local/ntop/share/ntop
This directory MUST be owned by the user
which you are going to use to run ntop.
The command you must issue is something like:
chown -R ntop.ntop /usr/local/ntop/share/ntop
or chown -R ntop:users /usr/local/ntop/share/ntop
man chown to check the syntax for YOUR system
************************************************************
************************************************************
groupadd ntop
useradd ntop -g ntop
chown -R ntop.ntop /usr/local/ntop/share/ntop
chown -R ntop.ntop /usr/local/ntop/var/ntop
如果运行了seliunx 必须执行安装seliunx 策略。
make install-selinux-policy
#启动运行
#第一次运行会初始化数据,要设置管理员密码
#Initializing gdbm databases
#Initializing ntop
#Initializing device eth0
#Initializing gdbm databases
#Initializing external applications
#INITWEB: Initializing web server
#-P 指定数据存放位置,-u 指定运行用户。
/usr/local/ntop/bin/ntop -u ntop
#需要输入admin密码
Please enter the password for the admin user: XXXXXX
#INITWEB: Initializing TCP/IP socket connections for web server
#INITWEB: Initialized socket, port 3000, address (any)
#发现一个错误:
**ERROR** RRD: Disabled - unable to create base directory (err 13, /usr/local/ntop/var/ntop/rrd)
分析数据目录没有写权限。
chown -R ntop.ntop /usr/local/ntop/var/ntop
#刚开始前台运行可以看到日志,帮助调试,没问题的后 -d demon方式运行。
/usr/local/ntop/bin/ntop -u ntop -d
#访问测试
http://localhost:3000