sar用于网络监控,但是还有其他更丰富的内容。
[root@oracle10g ~]# sar -n DEV 2 2
Linux 2.6.9-89.ELsmp (oracle10g) 03/31/2013
06:18:28 PM IFACE rxpck/s txpck/s rxbyt/s txbyt/s rxcmp/s txcmp/s rxmcst/s
06:18:30 PM lo 0.00 0.00 0.00 0.00 0.00 0.00 0.00
06:18:30 PM eth0 2.50 0.00 182.00 0.00 0.00 0.00 0.00
06:18:30 PM sit0 0.00 0.00 0.00 0.00 0.00 0.00 0.00
06:18:30 PM IFACE rxpck/s txpck/s rxbyt/s txbyt/s rxcmp/s txcmp/s rxmcst/s
06:18:32 PM lo 0.00 0.00 0.00 0.00 0.00 0.00 0.00
06:18:32 PM eth0 2.01 0.50 421.61 69.35 0.00 0.00 0.00
06:18:32 PM sit0 0.00 0.00 0.00 0.00 0.00 0.00 0.00
Average: IFACE rxpck/s txpck/s rxbyt/s txbyt/s rxcmp/s txcmp/s rxmcst/s
Average: lo 0.00 0.00 0.00 0.00 0.00 0.00 0.00
Average: eth0 2.26 0.25 301.50 34.59 0.00 0.00 0.00
Average: sit0 0.00 0.00 0.00 0.00 0.00 0.00 0.00
IFACE 设备名称
rxpck/s 每秒接收的数据包
txpck/s 每秒发送的数据包
rxbyt/s 每秒种接收的字节数
txbyt/s 每秒种发送的字节数
rxcmp/s 每秒接收的压缩包数
txcmp/s 每秒发送的压缩包数
rxmcst/s 每秒接收的多播数据包
以上是查看网卡的工作情况,下面看一下网卡的报错信息
[root@oracle10g ~]# sar -n EDEV 2 2
Linux 2.6.9-89.ELsmp (oracle10g) 03/31/2013
06:24:04 PM IFACE rxerr/s txerr/s coll/s rxdrop/s txdrop/s txcarr/s rxfram/s rxfifo/s txfifo/s
06:24:06 PM lo 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
06:24:06 PM eth0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
06:24:06 PM sit0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
06:24:06 PM IFACE rxerr/s txerr/s coll/s rxdrop/s txdrop/s txcarr/s rxfram/s rxfifo/s txfifo/s
06:24:08 PM lo 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
06:24:08 PM eth0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
06:24:08 PM sit0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
Average: IFACE rxerr/s txerr/s coll/s rxdrop/s txdrop/s txcarr/s rxfram/s rxfifo/s txfifo/s
Average: lo 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
Average: eth0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
Average: sit0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
rxerr/s 每秒接收的坏数据包
txerr/s 每秒发送的坏数据包
coll/s 每秒冲突数
rxdrop/s 由于缓冲满每秒丢弃的已接收的数据包数
txdrop/s 由于缓冲满每秒丢掉的一发送的数据包数
txcarr/s 发送数据包时每秒载波错误数
rxfram/s 每秒钟接收的数据数据包的帧对齐错误数
rxfifo/s 接收的数据包每秒种fifo过速的错误数
txfifo/s 发送的数据包每秒钟FIFO过速的错误数。
当然也可以使用sar 的 -c选项监控cpu使用情况,-d选项监控IO使用情况
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/23655288/viewspace-757600/
,如需转载,请注明出处,否则将追究法律责任。