Linux发展迅速,你了解Linux系统么?你是Linux系统的应用者么?今天有需求要配置ntop,本文为你详细介绍Linux配置 ntop,为你在学习Linux配置ntop时起一定的作用。用来监控网络情况。
装rpmforge:
#wget  ftp.freshrpms.net/pub/freshrpms/pub/dag/redhat/el5/en/i386/RPMS.dag/rrdtool-1.2.30-1.el5.rf.i386.rpm
源码包折腾一上午也不行,rpmforge还是很有用的啊。
- 装graphviz:
 - #yum install graphviz
 - 装ntop:
 - #yum install ntop
 - 改ntop.conf:
 - --user ntop
 - --db-file-path /var/ntop
 - --use-syslog=local1 #让ntop会记录日志到local1。
 - 改/etc/syslog.conf:
 - local1.* /var/log/ntop.log #和ntop.conf的里面对应,记得重启syslog服务。
 - 改/etc/init.d/ntop:
 - #!/bin/bash
 - #
 - # Init file for the NTOP network monitor
 - #
 - # chkconfig: 35 93 83 #这里加上35原来是-,让ntop在35级别自动启动。记得用#chkconfig ntop on
 - #
 - # description: NTOP Network Monitor
 - #
 - # processname: ntop
 - # config: /etc/ntop.conf
 - # pidfile: /var/run/ntop
 - # Source function library.
 - . /etc/rc.d/init.d/functions
 - # Source networking configuration.
 - . /etc/sysconfig/network
 - # Check that networking is up.
 - [ "${NETWORKING}" == "no" ] && exit 0
 - [ -x "/usr/bin/ntop" ] || exit 1
 - [ -r "/etc/ntop.conf" ] || exit 1
 - #[ -r "/var/ntop/ntop_pw.db" ] || exit 1
 - RETVAL=0
 - prog="ntop"
 - start () {
 - echo -n $"Starting $prog: "
 - daemon $prog @/etc/ntop.conf -d -L #这里原来是-d -L @.....但是会报错,改成这样就不回了。
 - RETVAL=$?
 - echo
 - [ $RETVAL -eq 0 ] && touch /var/lock/subsys/\$prog
 - return $RETVAL
 - }
 - stop () {
 - echo -n $"Stopping $prog: "
 - killproc $prog
 - RETVAL=$?
 - echo
 - [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/$prog
 - return $RETVAL
 - }
 - restart () {
 - stop
 - start
 - }
 - case "$1" in
 - start)
 - start
 - ;;
 - stop)
 - stop
 - ;;
 - restart|reload)
 - restart
 - ;;
 - condrestart)
 - [ -e /var/lock/subsys/$prog ] && restart
 - RETVAL=$?
 - ;;
 - status)
 - status $prog
 - RETVAL=$?
 - ;;
 - *)
 - echo $"Usage: $0 {start|stop|restart|condrestart|status}"
 - RETVAL=1
 - esac
 - exit $RETVAL
 
配置ntop:
在Admin-Preferences中添加dot.path /usr/bin/dot,实现绘图功能。
其他注意事项:
第一次启动前用下面的命令设置一个管理密码,以后web页面设置的时候用得到。用户名默认admin,密码就是下面的命令设置的。
#/usr/bin/ntop -P /var/ntop -u ntop -A
防火墙打开3000端口,或者配置文件修改成别的。这样就成功完成了Linux配置ntop。



;QQ联络:1360095750。