今天给大家分享两款Linux 系统上用于流量监控的利器,两个都是命令工具,安装简单,使用也超级方便!
用来排查服务器相关上网异常行为非常实用。
内容概要
- 1. iftop
- 2. nethogs
命令
# 安装企业扩展包 epel-release(Ubuntu、Debian系列的请将 yum 改成 apt)
yum -y install epel-release
# 安装 iftop
yum install -y iftop
# iftop 实时流量监控命令(-P 显示端口)
iftop -nNP
# iftop 在指定的网卡 eth0 上监控
iftop -nNP -i eth0
# 备注:iftop 监控模式下:
# 按大写 L,显示流量刻度;
# 按大写 T,显示总流量;
# 按大写 P,暂停流量监控
# 按小写 p,切换端口显示
# 安装 nethogs
yum -y install nethogs
# nethogs 实时进程流量监控命令
nethogs
# 查看进程命令
ps -ef
# 强制杀死指定的进程
kill -9 PID
如若转载,请注明出处:https://www.ozabc.com/jianzhan/534863.html