全面介紹Linux配置ntop

來源:互聯網
上載者:User

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還是很有用的啊。

  1. 裝graphviz:  
  2. #yum install graphviz  
  3. 裝ntop:  
  4. #yum install ntop  
  5. 改ntop.conf:  
  6. --user ntop  
  7. --db-file-path /var/ntop  
  8. --use-syslog=local1    #讓ntop會記錄日誌到local1。  
  9. 改/etc/syslog.conf:  
  10. local1.* /var/log/ntop.log    #和ntop.conf的裡面對應,記得重啟syslog服務。  
  11. 改/etc/init.d/ntop:  
  12. #!/bin/bash  
  13. #  
  14. # Init file for the NTOP network monitor  
  15. #  
  16. # chkconfig: 35 93 83    #這裡加上35原來是-,讓ntop在35層級自動啟動。記得用#chkconfig ntop on  
  17. #  
  18. # description: NTOP Network Monitor  
  19. #  
  20. # processname: ntop  
  21. # config: /etc/ntop.conf  
  22. # pidfile: /var/run/ntop  
  23. # Source function library.  
  24. . /etc/rc.d/init.d/functions  
  25. # Source networking configuration.  
  26. . /etc/sysconfig/network  
  27. # Check that networking is up.  
  28. [ "${NETWORKING}" == "no" ] && exit 0  
  29. [ -x "/usr/bin/ntop" ] || exit 1  
  30. [ -r "/etc/ntop.conf" ] || exit 1  
  31. #[ -r "/var/ntop/ntop_pw.db" ] || exit 1  
  32. RETVAL=0 
  33. prog="ntop" 
  34. start () {  
  35. echo -n $"Starting $prog: "  
  36. daemon $prog @/etc/ntop.conf -d -L    #這裡原來是-d -L @.....但是會報錯,改成這樣就不回了。  
  37. RETVAL=$?  
  38. echo  
  39. [ $RETVAL -eq 0 ] && touch /var/lock/subsys/\$prog  
  40. return $RETVAL  
  41. }  
  42. stop () {  
  43. echo -n $"Stopping $prog: "  
  44. killproc $prog  
  45. RETVAL=$?  
  46. echo  
  47. [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/$prog  
  48. return $RETVAL  
  49. }  
  50. restart () {  
  51. stop  
  52. start  
  53. }  
  54. case "$1" in  
  55. start)  
  56. start  
  57. ;;  
  58. stop)  
  59. stop  
  60. ;;  
  61. restart|reload)  
  62. restart  
  63. ;;  
  64. condrestart)  
  65. [ -e /var/lock/subsys/$prog ] && restart  
  66. RETVAL=$?  
  67. ;;  
  68. status)  
  69. status $prog  
  70. RETVAL=$?  
  71. ;;  
  72. *)  
  73. echo $"Usage: $0 {start|stop|restart|condrestart|status}"  
  74. RETVAL=1 
  75. esac  
  76. exit $RETVAL 

配置ntop:

在Admin-Preferences中添加dot.path /usr/bin/dot,實現繪圖功能。

其他注意事項:

第一次啟動前用下面的命令設定一個管理密碼,以後web版面設定的時候用得到。使用者名稱預設admin,密碼就是下面的命令設定的。

#/usr/bin/ntop -P /var/ntop -u ntop -A

防火牆開啟3000連接埠,或者設定檔修改成別的。這樣就成功完成了Linux配置ntop。

本文出自 “shark巨菜-菜園志” 部落格,請務必保留此出處http://sharkyan.blog.51cto.com/536264/245041

  1. 簡單介紹Fedora Linux飛信
  2. 精細講解Fedora Linux系統檔案的使用方法
  3. 描述概括Linux GCC穩定性的要求
  4. 深入瞭解Linux網路命令知識
  5. 保障Linux安全 安裝Linux防火牆

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.