Linux服務器---流量監控bandwidthd

Bandwidthd

Bandwidthd是一款免費的流量監控軟件,它可以用圖標的方式展現出網絡流量行爲,並且可區分出ftp、tcp等各種協議的流量。

1、安裝一些依賴軟件

[root@localhost bandwidthd-2.0.1]# yum install -y libpng libpng-devel gd gd-devel gcc libpcap-devel

2、下載bandwidthd軟件(https://sourceforge.net/projects/bandwidthd/files/bandwidthd/bandwidthd 2.0.1/

3、解壓bandwidthd。

[root@localhost ~]# tar -xzvf bandwidthd-2.0.1.tar.gz

4、安裝。Bandwidthd需要進行編譯安裝,首先要執行configure文件,生成makefile,然後在編譯、安裝

[root@localhost bandwidthd-2.0.1]# ./configure

[root@localhost bandwidthd-2.0.1]# make

[root@localhost bandwidthd-2.0.1]# make install

5、修改配置文件“/usr/local/bandwidthd/etc/bandwidthd.conf”,設置監聽的網段和網卡

[root@localhost bandwidthd-2.0.1]# gedit /usr/local/bandwidthd/etc/bandwidthd.conf 

 #subnet 10.0.0.0 255.0.0.0

#subnet 192.168.0.0/16

#subnet 172.16.0.0/12

subnet 192.168.0.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 "eth0"     //監聽網卡

6、建立鏈接,在apache網頁根目錄建立一個鏈接,指向bandwidthd,這樣可以快速打開bandwidthd

[root@localhost bandwidthd-2.0.1]# cd /var/www/html/

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

7、啓動bandwidthd

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

[root@localhost bandwidthd]# ./bandwidthd 

8、在瀏覽器輸入“127.0.0.1/bandwidthd”打開bandwidthd。請確保你已經開啓了httpd服務。

image001.png

9、設置bandwidthd開機啓動

[root@localhost html]# gedit /etc/rc.local

touch /var/lock/subsys/local

INITTY=/dev/tty[1-8]

for tty in $INITTY; do

    setleds -D +num < $tty

done

/usr/local/bandwidthd/bandwidthd

 


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章