由于最小系统的CentOS不带make,因此需要自己安装一个make
yum install make
安装完毕后,就可以make了
make
make install
检查哈有没有安装成功了
ls /usr/local/bandwidthd/
将Bandwidthd分析出的网页统计页面链接到httpd 程序下
在CentOS 6.4下,httpd 网页根目录默认是/var/www/html
在web 主目录下做bandwidthd软连接
ln -s /usr/local/bandwidthd/htdocs /var/www/html/bandwidthd
配置Bandwidthd的配置文件
vi /usr/local/bandwidthd/etc/bandwidthd.conf
加入你要监控的网段
subnet 10.0.0.0 255.255.0.0
subnet 10.1.0.0 255.255.0.0
subnet 10.2.0.0 255.255.0.0
subnet 10.3.0.0 255.255.0.0
subnet 10.4.0.0 255.255.0.0
subnet 10.5.0.0 255.255.0.0
subnet 192.168.0.0/16
subnet 172.16.25.0/24
subnet 172.16.10.0/24
subnet 172.16.11.0/24
subnet 172.16.12.0/24
subnet 172.16.13.0/24
subnet 172.16.14.0/24
subnet 172.16.15.0/24
subnet 172.16.16.0/24
subnet 172.16.17.0/24
subnet 172.16.18.0/24
subnet 172.16.19.0/24
subnet 172.16.20.0/24
subnet 172.16.31.0/24
subnet 172.16.32.0/24
subnet 172.16.33.0/24
subnet 172.16.34.0/24
subnet 172.16.35.0/24
subnet 172.16.36.0/24
启动bandwidthd、httpd
[root@localhost ~]#cd /usr/local/bandwidthd
[root@localname bandwidthd]#./bandwidthd
[root@localhost bandwidthd]# service httpd restart
稍微等几分钟(5分钟吧),就可以看到流量页面了。