Linux下网络流量实时监控工具
2016-04-06有时我们需要了解网卡当前流量情况。有很多小工具可以实现,也可以通过shell脚本实现。
1、wget wallcopper.com/tar/nmon
Network I/O -------------------------------------------------------|
|I/F Name Recv=KB/s Trans=KB/s packin packout insize outsize Peak->Recv |
| lo 16.9 16.9 40.4 40.4 427.5 427.5 26.6 |
| eth0 31.6 16.4 58.8 70.3 549.7 239.1 31.6 |
| eth1 13.7 34.9 86.2 85.2 163.1 419.5 13.7 34.9
2、yum -y install iptraf
iptraf
3、wget http://www.roland-riegel.de/nload/nload-0.7.2.tar.gz
tar zxvf nload-0.7.2.tar.gz
cd nload-0.7.2
./configure --prefix=/usr/local/nload
make
make install
/usr/local/nload/bin/nload eth0
4、wget http://gael.roualland.free.fr/ifstat/ifstat-1.1.tar.gz
tar -zxvf ifstat-1.1.tar.gz
cd ifstat-1.1
./configure --prefix=/usr/local/ifstat
make;make install
ifstat eth0
5、sar
yum install sysstat
sar -n DEV 5 2
6、iftop -i eth0
yum -y install libpcap-devel
wget http://www.ex-parrot.com/pdw/iftop/download/iftop-0.17.tar.gz
tar zxvf iftop-0.17.tar.gz
cd iftop-0.17
./configure --prefix=/usr/local/iftop
make
make install
或者
yum -y install iftop
rpm -ivh http://rpmfind.net/linux/dag/redhat/el5/en/x86_64/dag/RPMS/iftop-1.0-0.pre3.el5.rf.x86_64.rpm
iftop -F 10.46.163.6/24或# iftop -F 10.10.1.0/255.255.255.0
iftop -m 100M