巡检命令
巡检命令
ip -s link # 全部接口简表
ip -s link show eth0 # 单接口
ip -s -s link show eth0 # 二级详情(各类错误细分)
# 字段:RX: bytes packets errors dropped overrun mcast/proc/net/dev 与监控口径
/proc/net/dev 与监控口径
cat /proc/net/dev
# 两次采样差分:
awk '/eth0/{print $4" "$12}' /proc/net/dev # 粗略错误/丢包列(逐列含义见 ip -s 输出)巡检脚本用 ip -s link 的 JSON(ip -s -j link)比解析文本更稳;errors/dropped 分别统计协议错与资源不足丢包。