| 用途 | SNMP 风格网络计数器(含增量对比) |
|---|---|
| 语法 | nstat / nstat -az |
| 记忆 | 默认显示「距上次运行」的增量;-a 绝对值、-z 含零值项 |
常用示例
常用示例
nstat -az | grep -E 'TcpRetransSegs|TcpOutSegs|TcpAttemptFails'
nstat # 相对于上次运行的增量
nstat -az > /tmp/s1; sleep 300; nstat -az > /tmp/s2; diff /tmp/s1 /tmp/s2 | head # 窗口对比重传率 = TcpRetransSegs 增量 / TcpOutSegs 增量;超过 1% 就值得顺着丢包方向查。