Install NTOP pada CentOS 5.2

Sumber : Artikel dari cyberciti

Arahan ini telah diuji pada versi 32/64 bit sahaja :
a) RHEL Linux 5.x
b) CentOS Linux 5.x

Muatturun versi terkini NTOP

Dapatkan ntop terkini menggunakan wget :
# cd /opt
# wget http://freshmeat.net/redir/ntop/7279/url_tgz/ntop-3.3.6.tar.gz

Untar tar ball, enter:
# tar -zxvf ntop-3.3.6.tar.gz

Buat konfigurasi dan Compile ntop pada RHEL

Anda perlu ada perisian RRDTool bersama. Selain itu anda perlu install libpcap, enter:
# yum install libpcap-devel libpcap

Taip command berikut untuk compile dan install ntop :
# cd ntop
# ./autogen.sh

Taip make untuk compile ntop :
# make

Taip make install untuk install ntop:
# make install
# make install-data-as

Create ntop user

Taip command berikut untuk jalankan ntop atas ntop user, enter:
# useradd -M -s /sbin/nologin -r ntop

Setup directory permissions

Kemudian , anda perlu setup directory permissions, enter:
# chown ntop:root /usr/local/var/ntop/
# chown ntop:ntop /usr/local/share/ntop/

Setup ntop user admin password

Taip command berikut untuk create ntop admin password, enter:
# ntop -A

Sample output:

Mon Jul 28 03:38:34 2008 NOTE: Interface merge enabled by default
Mon Jul 28 03:38:34 2008 Initializing gdbm databases

ntop startup - waiting for user response!

Please enter the password for the admin user:
Please enter the password again:
Mon Jul 28 03:38:42 2008 Admin user password has been set

Start ntop

Type the following command to start ntop:
# /usr/local/bin/ntop -d -L -u ntop -P /usr/local/var/ntop --skip-version-check --use-syslog=daemon

Sample output:

Mon Jul 28 03:42:19 2008 NOTE: Interface merge enabled by default
Mon Jul 28 03:42:19 2008 Initializing gdbm databases

Jika anda ada banyak network interface (eth0, eth1 and so on), start ntop seperti berikut :
# /usr/local/bin/ntop -i "eth0,eth1" -d -L -u ntop -P /usr/local/var/ntop --skip-version-check --use-syslog=daemon
Where,

* -i "eth0,eth1" : Specifies the network interface or interfaces to be used by ntop for network monitoring. Here you are monitoring eth0 and eth1.
* -d : Run ntop as a daemon.
* -L : Send all log messages to the system log (/var/log/messages) instead of screen.
* -u ntop : Start ntop as ntop user
* -P /usr/local/var/ntop : Specify where ntop stores database files. You may need to backup database as part of your disaster recovery program.
* --skip-version-check : By default, ntop accesses a remote file to periodically check if the most current version is running. This option disables that check.
* --use-syslog=daemon : Use syslog daemon.

Bagaimana nak paparkan statistik ntop?

By default ntop listen kepada port 3000. Anda boleh view statistik ntop dengan melayari url berikut :
http://localhost:3000/
ATAU
http://server-ip:3000/
ntop in action


(Fig.01: ntop Global TCP/UDP Protocol Distribution Graphs [click to enlarge])



(Fig.02: Network Load Statistics (click to enlarge])
Open port 3000 using iptables

Buka folder berikut /etc/sysconfig/iptables file, enter:
# vi /etc/sysconfig/iptables
Append following code before final REJECT line:
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 3000 -j ACCEPT
Save and close the file. Restart firewall:
# service iptables restart

Bagaimana saya nak paparkan statistik ntop tanpa membuka port 3000?

Setup tunnel menggunakan ssh, masukkan yang berikut pada local UNIX / Linux desktop system:
$ ssh -L 3000:localhost:3000 -N -f user@server.yourcorp.com
Sekarang buka browser dan taip command berikut :
http://localhost:3000/

Bagaimana saya nak start ntop on boot?

Open /etc/rc.local file, enter:
# vi /etc/rc.local

Masukkan line berikut :
/usr/local/bin/ntop -i "eth0,eth1" -d -L -u ntop -P /usr/local/var/ntop --skip-version-check --use-syslog=daemon
Simpan dan tutup fail tersebut.

Bagaimana saya nak stop ntop?

Gunakan web interface untuk shutdown ntop atau gunakan kaedah command kill / killall :
# killall ntop

Selamat mencuba. PPTMK aku dah berjaya setup ntop atas server mysurfguard komtur aku.
Kira dalam tu ada mysurfguard + ntop.
Banyak trafik http dan P2P aku tengok dalam network di sana..
server specs :
1GB, XEON 3.0GHz, SERVER HP DL 140G3
OS : CentOS 5.2

~ Be a Creator Not a User ~

Ulasan

Tanpa Nama berkata…
mustar ni rajin betul pening2 kan kepala sendiri... heheh
muzzo berkata…
hehe, biase le pak mustar kan berfikiran jauh...hehe