今天介绍一款linux下监控即时宽带使用情况的软件iftop,iftop可以查看流量动态,帮助你解决、查找网络慢的问题。
当然查看网卡流量工具还有iptraf、nethogs等等,今天主要推荐iftop!
软件安装:
cd /byrd/tools/
wget http://www.ex-parrot.com/~pdw/iftop/download/iftop-0.17.tar.gz
tar zxf iftop-0.17.tar.gz
cd iftop-0.17
yum install flex byacc libpcap ncurses ncurses-devel libpcap-devel
./configure --prefix=/byrd/service/iftop-0.17
make && make install
软件参数:
[root@hk iftop-0.17]# /byrd/service/iftop-0.17/sbin/iftop -h
iftop: display bandwidth usage on an interface by host
Synopsis: iftop -h | [-npbBP] [-i interface] [-f filter code] [-N net/mask]
-h display this message
-n don't do hostname lookups
-N don't convert port numbers to services
-p run in promiscuous mode (show traffic between other
hosts on the same network segment)
-b don't display a bar graph of traffic
-B Display bandwidth in bytes
-i interface listen on named interface
-f filter code use filter code to select packets to count
(default: none, but only IP packets are counted)
-F net/mask show traffic flows in/out of network
-P show ports as well as hosts
-m limit sets the upper limit for the bandwidth scale
-c config file specifies an alternative configuration file
iftop, version 0.17
copyright (c) 2002 Paul Warren <pdw@ex-parrot.com> and contributors
界面说明:
"<="与"=>",表示的是流量的方向
"TX":从网卡发出的流量
"RX":网卡接收流量
"TOTAL":网卡发送接收总流量
"cum":iftop开始运行到当前时间点的总流量
"peak":网卡流量峰值
"rates":分别表示最近2s、10s、40s 的平均流量