安装
yum install sarstat
使用
sysstat安装之后将做为crontab任务运行,所以安装完成后,还需要等待一段时间收集数据
[root@MIO-2 ~]# sar Linux 2.6.32-358.el6.x86_64 (MIO-2) 09/07/2014 _x86_64_ (3 CPU) 03:50:01 PM CPU %user %nice %system %iowait %steal %idle 04:00:01 PM all 0.03 0.00 0.01 0.07 0.00 99.89 Average: all 0.03 0.00 0.01 0.07 0.00 99.89
查看网络统计
[root@MIO-2 ~]# sar -n DEV Linux 2.6.32-358.el6.x86_64 (MIO-2) 09/07/2014 _x86_64_ (3 CPU) 03:50:01 PM IFACE rxpck/s txpck/s rxkB/s txkB/s rxcmp/s txcmp/s rxmcst/s 04:00:01 PM lo 0.00 0.00 0.00 0.00 0.00 0.00 0.00 04:00:01 PM eth0 1.54 0.76 0.12 0.14 0.00 0.00 0.00 Average: lo 0.00 0.00 0.00 0.00 0.00 0.00 0.00 Average: eth0 1.54 0.76 0.12 0.14 0.00 0.00 0.00
查看内存统计
[root@MIO-2 ~]# sar -r Linux 2.6.32-358.el6.x86_64 (MIO-2) 09/07/2014 _x86_64_ (3 CPU) 03:50:01 PM kbmemfree kbmemused %memused kbbuffers kbcached kbcommit %commit 04:00:01 PM 1271824 2650988 67.58 243600 2151916 97024 1.61 Average: 1271824 2650988 67.58 243600 2151916 97024 1.61