使用iftop 流量监控 速率监控
0x00 使用iftop 流量监控 速率监控
使用iftop对流量监控,对总的发送速率进行监控
0x01 mac 安装 iftop
1 | brew reinstall iftop |
注:如果出现403的报错,下载直接失败的情况,建议换homebrew的源,再进行安装
参考 https://blog.csdn.net/god\_zzZ/article/details/119422419
加入软连接
1 | ln -s /usr/local/Cellar/iftop/1.0pre4/sbin/iftop /usr/local/bin/iftop |
查看帮助,安装成功
1 | iftop -h |
0x02 简单使用
监控 en0 网卡的流量
1 | sudo iftop -i en0 |
其他选项设置
1 | -i设定监测的网卡,如:# iftop -i eth1 |
0x03 shell 脚本
1 | sudo iftop -i en0 -P -n -t -L 1 -s 1 -B|grep "Total send rate:"|awk '{print $4}' >> /Users/zy/Desktop/2222.txt |
1 | |grep "Total send rate:" 筛选最后速率一行的全部 |
All articles in this blog are licensed under CC BY-NC-SA 4.0 unless stating additionally.