suchunta問題解決

跳到主文

生活或公司中遇到一些電腦問題 並紀錄解決辦法

部落格全站分類:

  • 相簿
  • 部落格
  • 留言
  • 名片
  • 9月 09 週一 201307:54
  • Centos 6安裝 Bandwidthd

1、基本編譯組件安裝

[root@localhost]# yum install gcc cpp glibc glibc-devel gcc-c++

2.、PCAP/PNG/GD Library(影像處理庫)

[root@localhost]# yum install libpcap libpcap-devel libpng libpng-devel gd gd-devel

3、安裝httpd

[root@localhost]# yum install httpd mod_ssl

[root@localhost]# service httpd start

[root@localhost]# chkconfig httpd on

4、下載bandwidthd

[root@localhost]#wget http://jaist.dl.sourceforge.net/project/bandwidthd/bandwidthd/bandwidthd%202.0.1/bandwidthd-2.0.1.tgz

5、安裝bandwidthd

解壓bandwidthd

[root@localhost]# tar -zxvf bandwidthd-2.0.1.tgz

編譯

[root@localhost]#cd bandwidthd-2.0.1

[root@localhostbandwidthd-2.0.1]# ./configure

[root@localhostbandwidthd-2.0.1]# make;make install

[root@localhost]# ll /usr/local/bandwidthd

總用量 64

-rwxr-xr-x1 root root 53320 3月 19 15:15 bandwidthd   //啟動bandwidthd檔

drwxr-xr-x2 root root  4096 3月 19 15:51 etc          //設定檔

drwxr-xr-x2 root root  4096 3月 19 15:25 htdocs       //web訪問目錄,可以作一個虛擬主機指過來

6、修改bandwidthd設定檔

[root@localhost]# vim /usr/local/bandwidthd/etc/bandwidthd.conf

####################################################

#Bandwidthd.conf

#

#Commented out options are here to provide

#documentation and represent defaults

#Subnets to collect statistics on.  Traffic that

#matches none of these subnets will be ignored.

#Syntax is either IP Subnet Mask or CIDR

subnet 10.1.3.0 255.255.255.0       #設置監控的網段

#subnet 192.168.0.0/24

subnet 172.16.1.0/24

#Device to listen on

#Bandwidthd listens on the first device it detects

#by default.  Run "bandwidthd -l" for a list of

#devices.

dev"any"  #(這是你要檢測的網卡ethx或any(所有),可以調整為對應的網路連接設備)
###################################################

#Options that don't usually get changed

#An interval is 2.5 minutes, this is how many

#intervals to skip before doing a graphing run

skip_intervals 1  #默認2.5minutes 刷新

#Graph cutoff is how many k must be transfered by an

#ip before we bother to graph it

graph_cutoff 1024   #預設1M以上的流量才有圖形

#Put interface in promiscuous mode to score to traffic

#that may not be routing through the host machine.

#promiscuous true   #設置網卡在混雜模式中記錄

#Log data to cdf file htdocs/log.cdf

output_cdf true   #在bandwidthd目錄中生成log2.cdf  以log.cdf格式資料記錄

#Read back the cdf file on startup

recover_cdf true   #在啟動bandwidth時重新讀取cdf的數據

#Libpcap format filter string used to control what bandwidthd see's

#Please always include "ip" in the string to avoid strange problems

filter "ip"   #以ip為過濾對象

#Draw Graphs – This default to true to graph the traffic bandwidthd is recording

#Usually set this to false if you only want cdf output or

#you are using the database output option.  Bandwidthd will use very little

#ram and cpu if this is set to false.

graph true    #圖形生成

#Set META REFRESH seconds (default 150, use 0 to disable).

meta_refresh 150   #網頁刷新時間

:wq              #保存

7、在web主目錄下做bandwidthd網頁連接,執行

[root@localhost]# cd /var/www/html/

[root@localhosthtml]# ln -s /usr/local/bandwidthd/htdocs bandwidthd

8、啟動bandwidthd、httpd

[root@localhost]#cd /usr/local/bandwidthd

[root@localname bandwidthd]#./bandwidthd

[root@localhost bandwidthd]# service httpd restart

9、設定開機自動啟動 bandwidthd

[root@localhost ]# vim /etc/rc.local

在最後添加內容:

#bandwidthd流量監控

/usr/local/bandwidthd/bandwidthd

10、過幾分鐘,就可以流覽bandwidthd 生成的圖形報表

http://IP/bandwidthd

文章標籤
全站熱搜
創作者介紹
創作者 suchunta 的頭像
suchunta

suchunta問題解決

suchunta 發表在 痞客邦 留言(0) 人氣(715)

  • 全站分類:
  • 個人分類:Linux
▲top

個人資訊

suchunta
暱稱:
suchunta
分類:
好友:
累積中
地區:

熱門文章

  • ()點Documents and Settings就出現存取被拒
  • ()解決mp3gain在windows 7 X64問題
  • ()如何完整移除Autodesk產品與暫存資訊
  • ()桌面右下角出現測試模式 Windows 7 組建 7601
  • ()windows update 目前無法檢查更新 因為該服務尚未執行
  • ()IE9無法開啟PDF檔
  • ()XP 你可能已經成為盜版軟體的受害者解決的方法或移除Office正版驗證OGA ?
  • ()如何linux下查看用戶列表
  • ()如何察看windows 的SID
  • ()找出暗中執行的程式

文章分類

  • Vista 問題 (0)
  • VMware (0)
  • Word 問題 (0)
  • Windows 問題 (0)
  • Outlook (0)
  • Norton (0)
  • Autodesk (0)
  • Windows 7 (0)
  • openfiler (0)
  • IE (0)
  • Office (0)
  • live mail (0)
  • Linux (0)
  • 未分類文章 (1)

最新文章

    最新留言

    文章精選

    文章搜尋

    誰來我家

    參觀人氣

    • 本日人氣:0
    • 累積人氣:507,610
    suchunta
    PIXNET Logo登入