#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