Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1394580
  • 博文数量: 343
  • 博客积分: 13098
  • 博客等级: 上将
  • 技术积分: 2862
  • 用 户 组: 普通用户
  • 注册时间: 2005-07-06 00:35
文章存档

2012年(131)

2011年(31)

2010年(53)

2009年(23)

2008年(62)

2007年(2)

2006年(36)

2005年(5)

分类: LINUX

2012-11-04 12:54:25

Sar is a system monitor command used to display system activity... its installed via the sysstat rpm. Use the command below to install sysstat.

[root@fedora ~]# yum -y install sysstat

Once installed you can check out the sysstat config file (/etc/sysconfig/sysstat) and configure how long to sar will keep your logfiles, on my system the default was 7 days. I changed this to 30 days.

The cron job for sar is located here (/etc/cron.d/sysstat) if you want to modify it as well.

Once installed and configured to your liking you must ensure that it starts and runs at boot time. I accomplished this via the command below.

[root@fedora ~]# chkconfig sysstat on && service sysstat start

Once up and running it will write its logs out to /var/log/sa, and you can read those files with the following command (sar -d , where filename is the name of the file that you want to read). Note that in the examples below, 3 is the interval, and 10 is the count.

Additonally you may run sar interatively, below are a few sample commands.

View disk i/o and transfer rate stats : [root@fedora cron.d]# sar -b 3 10

View memory and swap space stats : [root@fedora sa]# sar -r 3 10

View swapping stats : [root@fedora cron.d]# sar -W 3 10

View network stats : [root@fedora sa]# sar -n DEV 3 10

View CPU stats : [root@fedora sa]# sar -P ALL 3 10

View All stats : [root@fedora sa]# sar -A 3 10

阅读(852) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~