2022年8月、ホームページを全面リニューアルしました! 情報を分かりやすくお伝えできるサイト作りを目指してまいります。

New ntop DE IDS!

この技術の部屋のネタ ntop DE IDS! はntop-2.0ネタだったが、ここでは2006年5月現在のntop-3.2.tgzバージョンについてネタを書く。ntopの優れたところはネットワークのWeb表示にApache等のhttpdエンジンが無くても自己にhttpdエンジンを搭載しているのでお手軽だと言う事である。しかし、この手のツールに共通的に言える事だが、バージョンが上がる度にセットアップ手順が変わる。自分で作ってるわけではないので文句は言えないが、使う側としては戸惑いを隠せない。このntop-3.2.tgzにも言える、コンパイル&ビルドは簡単だけど、その後のライブラリのシンボルリンク作業とか必要ファイルのコピーやオーナー&グループの設定とかは初心者にはかなりきつい作業だ。正直、俺もこれらの設定作業には考えさせられた。ntop起動時のエラーとかワーニングを見ながらそれを全て消すつもりでデバッグしたのである。言い方を変えると、起動時にエラーとかワーニングを出してるんだからとても親切なツールとも言えそうだ。

セットアップ環境:
マシン:Celeron600 マイクロATXマシン
Linux:Slackware10( kozupon.com バックアップメール鯖 )


1.インストール準備
ntopをインストールするわけだが、その前に必要なライブラリモジュール等をインストールしておこう。

1)libpcapのインストール
注:ntopは、libpcap-0.6.x以上でないとインストールできても動かないので注意すること!(俺はこれでntop-2.0ネタのときにはまったぜ(ToT)!)
libpcapは、 ここ から落としてくる。2006年5月現在では、libpcap-0.9.4.tar.gzが最新であった。以降、/usr/local/srcへモジュールを落として展開作業する事とする。
root@hiro:/# cd /usr/local/src
root@hiro:/usr/local/src# tar zxvf libpcap-0.9.4.tar.gz
root@hiro:/usr/local/src# cd libpcap-0.9.4
root@hiro:/usr/local/src/libpcap-0.9.4# ./configure
root@hiro:/usr/local/src/libpcap-0.9.4# make

障害発生:
これは、ここでではない別のマシンのvinelinux3.2でlibpcap-0.9.4をコンパイル中、起こったmakeエラーだが、以下のように対処した。
省略
yacc -d grammar.y
make: yacc: Command not found
make: *** [grammar.c] Error 127

対処:
yaccコマンドが無いよっていっている。yaccは、字句解析モジュールbisonとアッパーコンパチなモジュールだ、ただし、同vinelinux3.2のapt-getのbisonにはyaccは入っていない。したがって、bisonのソースをコンパイル&ビルドする必要がある。
[root@note src]# wget http://ftp.gnu.org/gnu/bison/bison-2.1.tar.gz
[root@note src]# tar zxvf bison-2.1.tar.gz
[root@note src]# cd bison-2.1
[root@note bison-2.1]# ./configure
[root@note bison-2.1]# make
[root@note bison-2.1]# make install

これを入れて解決。

root@hiro:/usr/local/src/libpcap-0.9.4# make install

2)zlibのインストール
zlibをゲットする。 ここ で2006年5月現在最新の zlib-1.2.3.tar.gz をゲットしてコンパイルする。
root@hiro:/usr/local/src# tar zxvf zlib-1.2.3.tar.gz
root@hiro:/usr/local/src# cd zlib-1.2.3
root@hiro:/usr/local/src/zlib-1.2.3# ./configure
root@hiro:/usr/local/src/zlib-1.2.3# make
root@hiro:/usr/local/src/zlib-1.2.3# make install

3)gdbmのインストール
gdbmをゲットする。 ここ で2006年5月現在最新の gdbm-1.8.3.tar.gz をゲットしてコンパイルする。
root@hiro:/usr/local/src# tar zxvf gdbm-1.8.3.tar.gz
root@hiro:/usr/local/src# cd gdbm-1.8.3
root@hiro:/usr/local/src/gdbm-1.8.3# ./configure
root@hiro:/usr/local/src/gdbm-1.8.3# make
root@hiro:/usr/local/src/gdbm-1.8.3# make install

4)libpngのインストール
libpngをゲットする。 ここ で2006年5月現在最新の libpng-1.2.10.tar.bz2 をゲットしてコンパイルする。
root@hiro:/usr/local/src# tar jxvf libpng-1.2.10.tar.bz2
root@hiro:/usr/local/src# cd libpng-1.2.10
root@hiro:/usr/local/src/libpng-1.2.10# ./configure
root@hiro:/usr/local/src/libpng-1.2.10# make
root@hiro:/usr/local/src/libpng-1.2.10# make install

5)gdのインストール
gdをゲットする。 ここ で2006年5月現在最新の gd-2.0.33.tar.gz をゲットしてコンパイルする。
root@hiro:/usr/local/src# tar zxvf gd-2.0.33.tar.gz
root@hiro:/usr/local/src# cd gd-2.0.33
root@hiro:/usr/local/src/gd-2.0.33# ./configure
root@hiro:/usr/local/src/gd-2.0.33# make
root@hiro:/usr/local/src/gd-2.0.33# make install


2.ntopのインストール
1)データベースディレクトリの作成
root@hiro:/# mkdir /usr/local/etc/ntop

2)ntopユーザで実行するため、ntopユーザーとグループを作る
root@hiro:/# groupadd ntop
root@hiro:/# useradd -c “ntop user” -d /usr/local/etc/ntop -s /bin/true -g ntop ntop

3)ntopのインストール
いよいよ、ntopのインストールだ。ntopをゲットする。 ここ で2006年5月現在最新の ntop-3.2.tgz をゲットしてコンパイルする。
root@hiro:/usr/local/src# tar zxvf ntop-3.2.tgz
root@hiro:/usr/local/src# cd ntop-3.2
root@hiro:/usr/local/src/ntop-3.2# ./configure
root@hiro:/usr/local/src/ntop-3.2# make
root@hiro:/usr/local/src/ntop-3.2# make install


3.ntopをとりあえず起動してみる(データベースの初期化)
root@hiro:/usr/local/src/ntop-3.2# ntop -u ntop -P /usr/local/etc/ntop
だけど、ここでは多分エラーを吐いて止まるか、ワーニングでまくりだと思うので次の4項からのntopの設定を行った方が良い。
この作業は、ntopのデータベースの初期化作業なので、後に旨く動かない場合は、もう一度初期化を行うと良い。さらに、実行したままの状態から開放するには、CTRL+C or CTRL+Zを押せばよい。


4.ntopを手動で設定する
これからが、結構めんどくさい。だけど、多分この通りにやれば動くはずだ。
1)ライブラリのシンボルリンクを張る。
root@hiro:/# ln -s /usr/local/lib/libgd.so /usr/lib/
root@hiro:/# ln -s /usr/local/lib/libgd.so.2 /usr/lib/
root@hiro:/# ln -s /usr/local/lib/libmyrrd-3.2.so /usr/lib/
root@hiro:/# ln -s /usr/local/lib/libntop-3.2.so /usr/lib/
root@hiro:/# ln -s /usr/local/lib/libntopreport-3.2.so /usr/lib/

2)確認する
root@hiro:/# cd /usr/lib
root@hiro:/usr/lib# ls -atl | more
total 42636
drwxr-xr-x 22 root root 12288 2006-05-27 07:40 ./
lrwxrwxrwx 1 root root 23 2006-05-27 07:40 libgd.so -> /usr/local/lib/libgd.so*
lrwxrwxrwx 1 root root 25 2006-05-26 23:03 libgd.so.2 -> /usr/local/lib/libgd.so.2*
lrwxrwxrwx 1 root root 30 2006-05-26 23:01 libmyrrd-3.2.so -> /usr/local/lib/libmyrrd-3.2.so*
lrwxrwxrwx 1 root root 29 2006-05-26 23:00 libntop-3.2.so -> /usr/local/lib/libntop-3.2.so*
lrwxrwxrwx 1 root root 35 2006-05-26 22:59 libntopreport-3.2.so -> /usr/local/lib/libntopreport-3.2.so*省略

4)Autonomous System Number table fileのコピー
root@hiro:/usr/lib# cd /usr/local/etc/ntop
root@hiro:/usr/local/etc/ntop# cp /usr/local/src/ntop-3.2/AS-list.txt.gz .

5)ntop.pidを作る
root@hiro:/# touch /usr/local/etc/ntop/ntop.pid
root@hiro:/# chown ntop.ntop /usr/local/etc/ntop/ntop.pid


5.旨く起動したらこうなる
root@hiro:/# /usr/local/bin/ntop -u ntop -P /usr/local/etc/ntop -d
[2] 590
Sat May 27 09:20:41 2006 NOTE: Interface merge enabled by default
Sat May 27 09:20:41 2006 Initializing gdbm databases
Sat May 27 09:20:41 2006 ntop will be started as user nobody
Sat May 27 09:20:41 2006 ntop v.3.2 SourceForge .tgz
Sat May 27 09:20:41 2006 Configured on May 26 2006 22:45:33, built on May 26 2006 22:49:53.
Sat May 27 09:20:41 2006 Copyright 1998-2005 by Luca Deri <deri@ntop.org>
Sat May 27 09:20:41 2006 Get the freshest ntop from http://www.ntop.org/
Sat May 27 09:20:41 2006 NOTE: ntop is running from ‘ntop’
Sat May 27 09:20:41 2006 NOTE: (but see warning on man page for the –instance parameter)
Sat May 27 09:20:41 2006 NOTE: ntop libraries are in ‘/usr/lib’
Sat May 27 09:20:41 2006 Initializing ntop
Sat May 27 09:20:41 2006 Checking eth0 for additional devices
Sat May 27 09:20:41 2006 Resetting traffic statistics for device eth0
Sat May 27 09:20:41 2006 DLT: Device 0 [eth0] is 1, mtu 1514, header 14
Sat May 27 09:20:41 2006 Initializing gdbm databases
Sat May 27 09:20:41 2006 VENDOR: Loading MAC address table.
Sat May 27 09:20:41 2006 VENDOR: Checking for MAC address table file
Sat May 27 09:20:41 2006 VENDOR: File ‘./specialMAC.txt.gz’ does not need to be reloaded
Sat May 27 09:20:41 2006 VENDOR: ntop continues ok
Sat May 27 09:20:41 2006 VENDOR: Checking for MAC address table file
Sat May 27 09:20:41 2006 VENDOR: File ‘./oui.txt.gz’ does not need to be reloaded
Sat May 27 09:20:41 2006 VENDOR: ntop continues ok
Sat May 27 09:20:41 2006 Fingeprint: Loading signature file.
Sat May 27 09:20:41 2006 Fingeprint: …loaded 1697 records
Sat May 27 09:20:41 2006 ASN: Checking for Autonomous System Number table file
Sat May 27 09:20:41 2006 ASN: Loading file ‘./AS-list.txt.gz’
Sat May 27 09:20:44 2006 ASN: …found 111435 lines
Sat May 27 09:20:44 2006 ASN: ….Used 3780 KB of memory (12 per entry)
Sat May 27 09:20:44 2006 I18N: This instance of ntop does not support multiple languages
Sat May 27 09:20:44 2006 IP2CC: Checking for IP address <-> Country Code mapping file
Sat May 27 09:20:44 2006 IP2CC: Loading file ‘./p2c.opt.table.gz’
Sat May 27 09:20:45 2006 IP2CC: …found 52395 lines
Sat May 27 09:20:45 2006 GDVERCHK: Guessing at libgd version
Sat May 27 09:20:45 2006 GDVERCHK: … as 2.0.12-2.0.15
Sat May 27 09:20:45 2006 Initializing external applications
Sat May 27 09:20:45 2006 THREADMGMT[t123644848]: NPA: Started thread for network packet analyzer
Sat May 27 09:20:45 2006 THREADMGMT[t49523632]: SFP: Started thread for fingerprinting
Sat May 27 09:20:45 2006 THREADMGMT[t60009392]: SIH: Started thread for idle hosts detection
Sat May 27 09:20:45 2006 THREADMGMT[t123644848]: NPA: network packet analyzer (packet processor) thread running [p590]
Sat May 27 09:20:45 2006 THREADMGMT[t49523632]: SFP: Fingerprint scan thread starting [p590]
Sat May 27 09:20:45 2006 THREADMGMT[t60009392]: SIH: Idle host scan thread starting [p590]
Sat May 27 09:20:45 2006 THREADMGMT[t70495152]: DNSAR(1): Started thread for DNS address resolution
Sat May 27 09:20:45 2006 Calling plugin start functions (if any)
Sat May 27 09:20:45 2006 SSL is present but https is disabled: use -W <https port> for enabling it
Sat May 27 09:20:45 2006 INITWEB: Initializing web server
Sat May 27 09:20:45 2006 INITWEB: Initializing tcp/ip socket connections for web server
Sat May 27 09:20:45 2006 INITWEB: Initialized socket, port 3000, address (any)
Sat May 27 09:20:45 2006 INITWEB: Waiting for HTTP connections on port 3000
Sat May 27 09:20:45 2006 INITWEB: Starting web server
Sat May 27 09:20:45 2006 THREADMGMT[t80980912]: INITWEB: Started thread for web server
Sat May 27 09:20:45 2006 Listening on [eth0]
Sat May 27 09:20:45 2006 Loading Plugins
Sat May 27 09:20:45 2006 Searching for plugins in /usr/local/lib/ntop/plugins
Sat May 27 09:20:45 2006 ICMP: Welcome to ICMP Watch. (C) 1999-2005 by Luca Deri
Sat May 27 09:20:45 2006 LASTSEEN: Welcome to Host Last Seen. (C) 1999 by Andrea Marangoni
Sat May 27 09:20:45 2006 NETFLOW: Welcome to NetFlow.(C) 2002-05 by Luca Deri
Sat May 27 09:20:45 2006 PDA: Welcome to PDA. (C) 2001-2005 by L.Deri and W.Brock
Sat May 27 09:20:45 2006 RRD: Welcome to Round-Robin Databases. (C) 2002-04 by Luca Deri.
Sat May 27 09:20:45 2006 SNMP: Welcome to SNMP. (C) 2004 by F.Fusco and G.Giardina
Sat May 27 09:20:45 2006 SFLOW: Welcome to sFlow.(C) 2002-04 by Luca Deri
Sat May 27 09:20:45 2006 **WARNING** Unable to load plugin ‘/usr/local/lib/ntop/plugins/xmldumpPlugin.so’
Sat May 27 09:20:45 2006 **WARNING** Message is ‘/usr/local/lib/ntop/plugins/xmldumpPlugin.so: undefined symbol: dumpXML’
Sat May 27 09:20:45 2006 Calling plugin start functions (if any)
Sat May 27 09:20:45 2006 RRD: Welcome to the RRD plugin
Sat May 27 09:20:45 2006 RRD: Mask for new directories is 0700
Sat May 27 09:20:45 2006 RRD: Mask for new files is 0066
Sat May 27 09:20:45 2006 THREADMGMT: RRD: Started thread (t91466672) for data collection
Sat May 27 09:20:45 2006 THREADMGMT[t70495152]: DNSAR(1): Address resolution thread running [p590]
Sat May 27 09:20:45 2006 THREADMGMT[t80980912]: WEB: Server connection thread starting [p590]
Sat May 27 09:20:45 2006 Note: SIGPIPE handler set (ignore)
Sat May 27 09:20:45 2006 THREADMGMT[t80980912]: WEB: Server connection thread running [p590]
Sat May 27 09:20:45 2006 WEB: ntop’s web server is now processing requests
Sat May 27 09:20:45 2006 THREADMGMT[t91466672]: RRD: Data collection thread starting [p590]
Sat May 27 09:20:45 2006 THREADMGMT[t3086685888]: ntop RUNSTATE: INITNONROOT(3)
Sat May 27 09:20:45 2006 Now running as requested user ‘nobody’ (99:99)
Sat May 27 09:20:45 2006 INIT: Created pid file (/usr/local/etc/ntop/ntop.pid)
Sat May 27 09:20:45 2006 Note: Reporting device initally set to 0 [eth0] (merged)
Sat May 27 09:20:45 2006 THREADMGMT[t3086685888]: ntop RUNSTATE: RUN(4)
Sat May 27 09:20:45 2006 THREADMGMT[t101952432]: NPS(1): Started thread for network packet sniffing
Sat May 27 09:20:45 2006 THREADMGMT[t101952432]: NPS(1,eth0): pcapDispatch thread starting [p590]
Sat May 27 09:20:45 2006 THREADMGMT[t101952432]: NPS(1,eth0): pcapDispatch thread running [p590]
Sat May 27 09:20:45 2006 THREADMGMT[t60009392]: SIH: Idle host scan thread running [p590]
Sat May 27 09:20:45 2006 THREADMGMT[t49523632]: SFP: Fingerprint scan thread running [p590]
Sat May 27 09:20:55 2006 THREADMGMT[t112438192]: RRD: Started thread for throughput data collection
Sat May 27 09:20:55 2006 THREADMGMT[t91466672]: RRD: Data collection thread running [p590]
Sat May 27 09:20:55 2006 THREADMGMT[t112438192]: RRD: Throughput data collection: Thread starting [p590]
Sat May 27 09:20:55 2006 THREADMGMT[t112438192]: RRD: Throughput data collection: Thread running [p590]


6.起動スクリプトを作る
ここでは、Slackware10の場合の起動スクリプトを紹介する。

root@hiro:/etc/rc.d# vi rc.ntop
#!/bin/sh
# Start/stop/restart the ntop server:

ntop_start() {
    /usr/local/bin/ntop -u ntop -P /usr/local/etc/ntop -d
}

ntop_stop() {
    kill -9 `cat /usr/local/etc/ntop/ntop.pid`
}

ntop_restart() {
    kill -9 `cat /usr/local/etc/ntop/ntop.pid`
    sleep 2
    ntop_start
}

case “$1” in
‘start’)
    ntop_start
;;
‘stop’)
    ntop_stop
;;
‘restart’)
    ntop_restart
;;
*)
echo “usage $0 start|stop|restart”
esac

この中で、stop関数ではkillallは使えなかった。したがって、ntop.pidでkillするようにした。

root@hiro:/etc/rc.d# chmod 755 rc.ntop
Slackware10の場合は、rc.ntopのような起動スクリプトを/etc/rc.dディレクトリに作って実行権を付けて、同ディレクトリ内のrc.Mファイルに以下のように追加してやる事で起動時及び再起動時に自動実行される。
root@hiro:/etc/rc.d# vi rc.M
省略
# Start ntop server:
if [ -x /etc/rc.d/rc.ntop ]; then
. /etc/rc.d/rc.ntop start
fi
省略


7.起動する
ntopスクリプトを起動する。起動スクリプトは-dオプションでデーモンモードで動かす設定にしたので、
root@hiro:/# /etc/rc.d/rc.ntop start
Sat May 27 16:27:32 2006 NOTE: Interface merge enabled by default
Sat May 27 16:27:32 2006 Initializing gdbm databases
Sat May 27 16:27:32 2006 ntop will be started as user nobody
Sat May 27 16:27:32 2006 ntop v.3.2 SourceForge .tgz
Sat May 27 16:27:32 2006 Configured on May 26 2006 22:45:33, built on May 26 2006 22:49:53.
Sat May 27 16:27:32 2006 Copyright 1998-2005 by Luca Deri <deri@ntop.org>
Sat May 27 16:27:32 2006 Get the freshest ntop from http://www.ntop.org/
Sat May 27 16:27:32 2006 NOTE: ntop is running from ‘/usr/local/bin’
Sat May 27 16:27:32 2006 NOTE: (but see warning on man page for the –instance parameter)
Sat May 27 16:27:32 2006 NOTE: ntop libraries are in ‘/usr/local/lib’
Sat May 27 16:27:32 2006 Initializing ntop
Sat May 27 16:27:33 2006 Checking eth0 for additional devices
Sat May 27 16:27:33 2006 Resetting traffic statistics for device eth0
Sat May 27 16:27:33 2006 DLT: Device 0 [eth0] is 1, mtu 1514, header 14
Sat May 27 16:27:33 2006 Initializing gdbm databases
Sat May 27 16:27:33 2006 VENDOR: Loading MAC address table.
Sat May 27 16:27:33 2006 VENDOR: Checking for MAC address table file
Sat May 27 16:27:33 2006 VENDOR: File ‘/usr/local/etc/ntop/specialMAC.txt.gz’ does not need to be reloaded
Sat May 27 16:27:33 2006 VENDOR: ntop continues ok
Sat May 27 16:27:33 2006 VENDOR: Checking for MAC address table file
Sat May 27 16:27:33 2006 VENDOR: File ‘/usr/local/etc/ntop/oui.txt.gz’ does not need to be reloaded
Sat May 27 16:27:33 2006 VENDOR: ntop continues ok
Sat May 27 16:27:33 2006 Fingeprint: Loading signature file.
Sat May 27 16:27:33 2006 Fingeprint: …loaded 1697 records
Sat May 27 16:27:33 2006 INIT: Parent process is exiting (this is normal)
Sat May 27 16:27:33 2006 INIT: Bye bye: I’m becoming a daemon…


8.ntopを4242番ポートでSSLを使って動かす

1)opensslを予め入れておく
root@hiro:/# slackpkg update
root@hiro:/# slackpkg install openssl openssl-solibs

2)sslを使うために再度ソースをビルドする
root@hiro:/# cd /usr/local/src/ntop-3.2
root@hiro:/usr/local/src/ntop-3.2# ./configure –enable-ssl
root@hiro:/usr/local/src/ntop-3.2# make
root@hiro:/usr/local/src/ntop-3.2# make install

3)付属のSSL鍵をコピーする
root@hiro:/usr/local/src/ntop-3.2# cp ntop/*pem /usr/local/etc/ntop

4)データベースの初期化
前述からのセットアップの段階で行ってない場合には実行する。
root@hiro:/usr/local/src/ntop-3.2# ntop -u ntop -P /usr/local/etc/ntop
実行したら、CTRL+C or CTRL+Zを押さなければ終了しないので注意。

5)adminパスワードの設定
root@hiro:/usr/local/src/ntop-3.2#
 ntop -A -u ntop -P /usr/local/etc/ntop

6)syslogを設定する
■ syslog.confへntop.logを追加する
root@hiro:/usr/local/src/ntop-3.2# cd /etc
root@hiro:/etc# vi syslog.conf
省略
local3.*             /var/log/ntop.log

■ ログローティションを設定する
root@hiro:/etc# vi logrote.d/syslog
/var/log/messages /var/log/secure /var/log/maillog /var/log/spooler /var/log/boot.log /var/log/cron
/var/log/ntop.log {
sharedscripts
postrotate
/bin/kill -HUP `cat /var/run/syslogd.pid 2> /dev/null` 2> /dev/null || true
endscript
}

7)起動する
root@hiro:/usr/local/src/ntop-3.2# /usr/local/bin/ntop -u ntop –use-syslog=local3 -P /usr/local/etc/ntop -W 4242 -d   
← 一行で
この起動コマンドオプションの意味 : ntopユーザで、syslogファシリティはlocal3、データベースディレクトリは/usr/local/etc/ntop、ポートは4242番、デーモンモードで実行。


9.DebianGNULinuxのapt-getでntopをインストールする(SSLを使う)

1)apt-getでインストール
jerry:/# apt-get install openssl
jerry:/# apt-get install ntop
Which interfaces should ntop listen on?
eth0

Which is the name of the user to run the ntop daemon as ?
ntop

上のように、二つばかり聞いてくるが、俺は両方ともOKにした。
インストールが終わったら、ntopがいきなり起動するので、一度止めておく。
jerry:/# /etc/init.d/ntop stop

2)付属のSSL鍵をコピーする
jerry:/# cd /var/lib/ntop
jerry:/# cp -p /etc/ntop/*pem .

3)adminパスワードを設定する
jerry:/# ntop -A -u ntop -P /var/lib/ntop

Please enter the password for the admin user:xxxxxxxx
Please enter the password again:xxxxxxxx

4)起動スクリプトの訂正
jerry:/# cd /etc/init.d
jerry:/etc/init.d# vi ntop

#! /bin/sh

DAEMON=”/usr/sbin/ntop”
NAME=”ntop”
DESC=”network top daemon”
INIT=”/etc/default/ntop”
HOMEDIR=”/var/lib/ntop”
LOGDIR=”/var/log/ntop/”

test -f $DAEMON || exit 0

test -f $INIT || exit 0

. $INIT

case “$1” in
start)
  echo -n “Starting $DESC: “
  start-stop-daemon –start –quiet –name $NAME –exec $DAEMON — \
  -d -L -u $USER -P $HOMEDIR –skip-version-check \
  -a /var/log/ntop/access.log -i “$INTERFACES” -W 4242 \
  -O $LOGDIR $GETOPT
  if ps xa | grep -v grep | grep /usr/sbin/ntop > /dev/null ; then
    echo ntop
  else
    echo “ntop not started. Read /usr/share/doc/ntop/README.Debian.”
  fi
;;
stop)
  echo -n “Stopping $DESC: “
  start-stop-daemon –stop –oknodo –name $NAME –user $USER –retry 9
  if ps xa | grep -v grep | grep /usr/sbin/ntop > /dev/null ; then
    echo “Ntop not stopped. Need to kill manually.”
  else
    echo ntop
  fi
;;
restart | force-reload)
  $0 stop
  sleep 2
  $0 start
;;
reload)
  if ps aux | grep -v grep | grep -q ‘/usr/sbin/ntop’ ; then
    $0 stop
    sleep 2
    $0 start
  fi
;;
*)
N=/etc/init.d/$NAME
echo “Usage: $N {start|stop|restart|force-reload}” >&2
exit 1
;;
esac
exit

上の濃い青文字の部分を追加。

5)起動する
jerry:/# /etc/init.d/ntop start


10.運用
運用は、Webベースで表示させてるのが一般的だろう。したがって、Webブラウザから、

http://ホスト名:3000/
SSLを使った場合: https://ホスト名:4242/

で表示させる事が出来る。以下に、俺が運用している画面を紹介する。全てではないが、All Protocolsの、
図1:トラフィック
図2:スループット
図3:アクティビティ

この3つの画面を紹介する。

図1
図2
図3

以上

コメント