#!/bin/bash # # Init file for the NTOP network monitor # # # description: NTOP Network Monitor # # processname: ntop # config: /etc/ntop.conf # pidfile: /var/lib/ntop/ntop.pid # # READ FIRST # Before you run this script make sure you run: # `ntop -u ntop -A` to assign an admin password # for the admin wui interfaz. [ -x "/usr/bin/ntop" ] || exit 1 #[ -r "/etc/ntop.conf" ] || exit 1 [ -r "/var/lib/ntop/ntop_pw.db" ] || exit 1 RETVAL=0 PROG="ntop" DAEMONOPTS="-u ntop -d -L" INTERFACES="" # If you dont want ntop to put the network interfaces in promicuos mode set the -s flag" # if you want to monitor more networks interfaces list your NICs in the INTERFACES variable:" # using the -i flag. for example: # INTERFACES="-i "eth0,eth1"" # and if you want to switch beetween the diferent network interfaces to see the statistics" # uses the -M flag" # Example: # DAEMONOPTS="-u ntop -d -L -s -M" # INTERFACES="-i "eth0,eth1"" start () { echo -n $"Starting $PROG: " $PROG $DAEMONOPTS $INTERFACES RETVAL=$? echo [ $RETVAL -eq 0 ] && touch /var/lock/subsys/\$PROG return $RETVAL } stop () { echo -n $"Stopping $PROG: " killall $PROG RETVAL=$? echo [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/$PROG return $RETVAL } restart () { stop sleep 2 start } case "$1" in start) start ;; stop) stop ;; restart|reload) restart ;; condrestart) [ -e /var/lock/subsys/$PROG ] && restart RETVAL=$? ;; *) echo $"Usage: $0 {start|stop|restart|condrestart|status}" RETVAL=1 esac exit $RETVAL