安装执行#sar 命令时会提示如下错误
[root@payne sysstat-10.2.0]# sar
Cannot open /var/log/sa/sa23: No such file or directory
23代表当天日期
使用参数-o 让其生成该文件
[root@payne sysstat-10.2.0]# sar -o 23
Linux 2.6.32-358.el6.i686 (payne) 01/23/2014 _i686_ (1 CPU)
[root@payne sysstat-10.2.0]# sar
Cannot open /var/log/sa/sa23: No such file or directory
23代表当天日期
使用参数-o 让其生成该文件
[root@payne sysstat-10.2.0]# sar -o 23
Linux 2.6.32-358.el6.i686 (payne) 01/23/2014 _i686_ (1 CPU)
08:57:07 AM CPU %user %nice %system %iowait %steal %idle
08:57:30 AM all 0.00 0.00 0.79 0.04 0.00 99.17
^C
08:57:43 AM all 0.00 0.00 0.79 0.08 0.00 99.13
Average: all 0.00 0.00 0.79 0.06 0.00 99.15
[root@payne sysstat-10.2.0]# sar
Linux 2.6.32-358.el6.i686 (payne) 01/23/2014 _i686_ (1 CPU)
08:57:30 AM all 0.00 0.00 0.79 0.04 0.00 99.17
^C
08:57:43 AM all 0.00 0.00 0.79 0.08 0.00 99.13
Average: all 0.00 0.00 0.79 0.06 0.00 99.15
[root@payne sysstat-10.2.0]# sar
Linux 2.6.32-358.el6.i686 (payne) 01/23/2014 _i686_ (1 CPU)
08:57:07 AM CPU %user %nice %system %iowait %steal %idle
08:57:30 AM all 0.00 0.00 0.79 0.04 0.00 99.17
08:57:43 AM all 0.00 0.00 0.79 0.08 0.00 99.13
Average: all 0.00 0.00 0.79 0.06 0.00 99.15
或者Put a time interval and count following the sar command:
[root@payne sysstat-10.2.0]# sar 1 2
Linux 2.6.32-358.el6.i686 (payne) 01/23/2014 _i686_ (1 CPU)
08:57:30 AM all 0.00 0.00 0.79 0.04 0.00 99.17
08:57:43 AM all 0.00 0.00 0.79 0.08 0.00 99.13
Average: all 0.00 0.00 0.79 0.06 0.00 99.15
或者Put a time interval and count following the sar command:
[root@payne sysstat-10.2.0]# sar 1 2
Linux 2.6.32-358.el6.i686 (payne) 01/23/2014 _i686_ (1 CPU)
08:57:07 AM CPU %user %nice %system %iowait %steal %idle
08:57:30 AM all 0.00 0.00 0.79 0.04 0.00 99.17
08:57:43 AM all 0.00 0.00 0.79 0.08 0.00 99.13
Average: all 0.00 0.00 0.79 0.06 0.00 99.15
又或者添加crontab,自动创建该sa*文件
[root@payne sa]# crontab -l
*/20 * * * * root /usr/lib/sa/sa1 1 2
30 23 * * * root /usr/lib/sa/sa2 -A
详见http://www.webhostingtalk.com/showthread.php?t=540137
08:57:30 AM all 0.00 0.00 0.79 0.04 0.00 99.17
08:57:43 AM all 0.00 0.00 0.79 0.08 0.00 99.13
Average: all 0.00 0.00 0.79 0.06 0.00 99.15
又或者添加crontab,自动创建该sa*文件
[root@payne sa]# crontab -l
*/20 * * * * root /usr/lib/sa/sa1 1 2
30 23 * * * root /usr/lib/sa/sa2 -A
详见http://www.webhostingtalk.com/showthread.php?t=540137
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/27135177/viewspace-1193624/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/27135177/viewspace-1193624/