#mkdir /etc/ntop |
<ntop.conf>
#vi /etc/ntop/ntop.conf --daemon --interface eth0,eth1,br0,tap0,lo --user ntop --use-syslog=daemon --db-file-path /usr/local/ntop/var/ntop --trace-level 3 --http-server 0.0.0.0:3001 --disable-schedyield --skip-version-check=yes
:wq |
<ntop 데몬>
#vi /etc/init.d/ntop #!/bin/bash # # Startup script Ntop # chkconfig:2345 81 19 # description: Network Traffic Monitor # processname: ntop # pidfile: /var/run/ntop.pid # config: /etc/ntop/ntop.conf # ### Boot Script # Source funtion library . /etc/rc.d/init.d/functions # Path to the ntop program prog=ntop ntop=/usr/local/ntop/bin/$prog pidfile=/var/run/$prog.pid config=/etc/ntop/ntop.conf start() { echo -n $"Starting $prog: " [ -x $ntop ] ||exit 1 [ -r "/etc/ntop/ntop.conf" ] || exit 6 if [ ! -r "/usr/local/ntop/var/ntop/ntop_pw.db" ]; then echo "Service not Configured. Run ntop Manually" exit 6 fi
# ntop has string error in locales other than "C" LANG=C daemon "$ntop @$config --daemon > /dev/null" RETVAL=$? echo [ $RETVAL -eq 0 ] && touch /var/lock/subsys/$prog return $RETVAL } stop() { echo -n $"Stopping $prog: " killproc -p $pidfile $ntop RETVAL="$?" echo [ $RETVAL -eq 0 ] && rm -f /var/subsys/$prog $pidfile } reload() { echo -n $"Reloading @prog: " killproc $ntop -HUP RETVAL=$? echo } case "$1" in start) start ;; stop) stop ;; status) status $ntop RETVAL=$? ;; restart) stop start RETVAL=$? ;; condrestart) if [ -f /var/run/$prog.pid ] ; then stop start fi RETVAL=$? ;; reload) reload ;; *) echo $"usage: $prog {start|stop|restart|condrestart|reload|status}" RETVAL=3 esac exit $RETVAL |
<ntop 데몬, 서비스 등록 및 재시작>
#chmod 755 /etc/init.d/ntop #chkconfig –add ntop #chkconfig –level 35 ntop on
#service ntop restart Stopping ntop: [ OK ] Starting ntop: [ OK ]
ntop.conf에 지정된 네트워크 장치가 다 올라왔는지 확인해보자. |