NTOP網路監視  

[by 狼主的網路實驗室]   [部份資料參考自: ADJ網路實驗室]

NTOP 是一套監測區域網路內封包數量的軟體,它可以搭配 MRTG ,找出網路大量封包暴增之所在.

同時以圖形化顯示,讓統計結果簡單易讀.

測試環境:

Redhat 9.0

已安裝 mysql 及 gnu C 等套件

 

1.先下載 Source RPM 檔

http://www.ntop.org

選擇適當的版本

 

 

2.開始進行解壓工作

[root@test root]# rpm -ihv  ntop-2.2-0.src.rpm

它解開後會放到   /usr/src/redhat/SOURCES/ntop-2.2    這個目錄

cd /usr/src/redhat/SOURCES/ntop-2.2

 

會看到兩個目錄

[root@test ntop-2.2]# ls

gdchart0.94c ntop

[root@test ntop-2.2]# 

先compiler gdchart

[root@test  ntop-2.2]# cd gdchart0.94c/

[root@test gdchart0.94c]# ./configure

.
.
Do not forget to build:
1. gd-1.8.3/libpng-1.2.4
2. zlib-1.1.4/

最後會看到提醒你要build libpng and zlib.......

再繼續下一步之前...必須先compiler 那兩樣...

先build libpng...

[root@test gdchart0.94c]# cd gd-1.8.3/libpng-1.2.4/

[root@test libpng-1.2.4]# cp scripts/makefile.linux Makefile

[root@test libpng-1.2.4]# make

再build zlib﹕

[root@test gdchart0.94c]# cd ../../zlib-1.1.4
[root@test zlib-1.1.4]# ./configure
[root@test zlib-1.1.4]# make

再來就可以compiler gdchart:

[root@test zlib-1.1.4]# cd ..
[root@test gdchart0.94c]# make
gdchart的部份到這邊告一段落...

接下來進行 ntop 的編譯 ...

 

3.Compile NTOP:

回到 ntop 目錄

[root@test gdchart0.94c]# cd ../ntop/

[root@test ntop]# ./configure

[root@test ntop]# make

這部份會花比較久的時間......接著再﹕

[root@test ntop]# make install

**重要:

編譯安裝完並未建立 /usr/local/var/ntop/ 

需先手動建立

[root@test ntop]# mkdir /usr/local/var/ntop/ 

到此完成, 接下來看看完成的畫面...

 

4.執行 NTOP:

執行方式如下:
[root@test ntop]# ntop -P /usr/local/var/ntop/ -u nobody

第一次執行它會要你輸入admin的password...它預設密碼也是admin...
第二次執行就不用再輸入..
這時你可以打開web browser..輸入:

http://<your_IP>:3000

你就會看到如下圖...代表已成功安裝 :

 

不過你會發現...執行上面指令會把terminal視窗佔住...
你可以先"ctrl+z"先 stop 住...再下" bg %1"(假設它在你的jobs裡數字是1)...
這樣就可以丟到背景執行...
或是重新執行下面指令:
[root@test ntop]# nohup ntop -P /usr/local/var/ntop/ -u nobody &

5.開機自動執行 NTOP:

[root@test ntop]# cd /etc/rc.d

編輯 rc.local

最後一行加入

nohup /usr/local/bin/ntop -P /usr/local/var/ntop/ -u nobody &

重新開機後即可自動啟動 NTOP