Linux下查看网卡流量方法
Linux通过vnstat查看网卡流量有两种安装方式:
yum 安装或者源码编译安装。
yum安装
直接运行
yum install vnstat -y
安装完后测试:
[root@21yunwei ~]# vnstat -l -i eth0 Monitoring eth0... (press CTRL-C to stop) rx: 0 kbit/s 0 p/s tx: 0 kbit/s 0 p/s^C eth0 / traffic statistics rx | tx --------------------------------------+------------------ bytes 14.35 MiB | 13.87 MiB --------------------------------------+------------------ max 5.80 Mbit/s | 3.67 Mbit/s average 82.87 kbit/s | 80.08 kbit/s min 0 kbit/s | 0 kbit/s --------------------------------------+------------------ packets 16142 | 10523 --------------------------------------+------------------ max 626 p/s | 316 p/s average 11 p/s | 7 p/s min 0 p/s | 0 p/s --------------------------------------+------------------ time 23.65 minutes
源码编译方式安装vnstat
适用于个别系统无法yum安装的情况。
wget http://xxx.com/vnstat-1.10.tar.gz tar xvzf vnstat-1.10.tar.gz cd vnstat-1.10 make make install
安装完以后,使用方式一样
相关推荐
farwang 2020-11-25
星愿心愿 2020-11-24
tianhuak 2020-11-24
zhjn0 2020-11-24
昭君出塞 2020-11-23
bluecarrot 2020-11-23
linuxwcj 2020-10-21
以梦为马不负韶华 2020-10-20
彼岸随笔 2020-10-20
yutou0 2020-10-17
applecarelte 2020-10-16
ourtimes 2020-10-16
waterhorse 2020-09-19
MRFENGG 2020-11-11
rainandtear 2020-10-30
kyssfanhui 2020-10-20
liuhangtiant 2020-10-20