bandwidthd流量监控-总结

bandwidthd流量监控

一、简介

         1. bandwidthd在任何一台电脑可以通过web界面用浏览器查看经过网关的各个ip流量,而且是分协议,分颜色显示,已经有直观的图象曲线.

         2. 如果在网关上装上bandwidthd ,就可以追踪的是各个的 IP 的流量,而且可以用图象曲线显示各个ip的相应不同协议显示,还能分时段查看,例如:包含FTPHTTPP2PTCPUDPICMP协议的各自流量,IP为统计对象.

         3.bandwithd主要基于sniffer的原理,最好安装在网关上。

         4. bandwithd生成的web首页中默认只显示“Top 20”个ip的信息。

二、安装

      1.安装基本包和图像处理

                   yum install gcc cpp glibc glibc-devel gcc-c++ libpcap libpcap-devel libpng libpng-devel gd gd-devel httpd -y

      2.安装bandwithd

                   tar -axf bandwidthd-1.2.0.tgz -C /usr/local/src/

                   cd /usr/local/src/bandwidthd-1.2.0/

                   make

                   make install

                   ln -s /usr/local/bandwidthd/htdocs /var/www/html/bandwidthd

      3.修改配置文件

                   vi /usr/local/bandwidthd/etc/bandwidthd.conf

subnet 10.1.3.0 255.255.255.0                       #设置监控的网段

dev "any"                                     #(这是你要检测的网卡ethxany(所有),

可以调整为对应的网络连接设备)

skip_intervals 1                                #默认2.5 minutes 刷新

graph_cutoff 1024                              #默认1M 以上的流量才有图形

#promiscuous true                              #设置网卡在混杂模式中记录

output_cdf true                                #bandwidthd目录中生成log2.cdf 

log.cdf格式数据记录

recover_cdf true                               #在启动bandwidth时重新读取cdf的数据

filter "ip"                                      #ip为过滤对象

graph true                                     #图形生成

meta_refresh 150                              #网页刷新时间

 

4.启动bandwidthdhttpd

                   /usr/local/bandwidthd/bandwidthd

                   /etc/init.d/httpd restart

                   echo “/usr/local/bandwidthd/bandwidthd” >> /etc/rc.local

5.访问web

                   http://ip/bandwidthd

三、其他设置

1.web中显示多个数据100

                   tar -axf bandwidthd-1.2.0.tgz -C /usr/local/src/

                   cd /usr/local/src/bandwidthd-1.2.0/

                   vi graph.c

273                     for (Counter=0; Counter < 101 && Counter < NumIps; Counter++)

279                     for (Counter=0; Counter < 101 && Counter < NumIps; Counter++)

        sed -i "s/Top[ ]\?20/Top\ 100/g" graph.c

                   make

                   make install

            ln -s /usr/local/bandwidthd/htdocs /var/www/html/bandwidthd

bandwidthd流量监控-总结_第1张图片

你可能感兴趣的:(流量监控,bandwidthd)