- 论坛徽章:
- 0
|
我所用的是这个版本的sysstat-6.0.1.tar.gz,还是比较好用的.
以下是本人写的安装说明,呵呵
1.上传tar文件,目前6.0.1为最高版本
2. 安装
#cd /apps/leo
#tar zxf sysstat-6.0.1.tar.gz
#cd sysstat-6.0.1
#make config
Installation directory: [/usr/local]
sadc directory: [/usr/local/lib/sa]
System activity directory: [/var/log/sa]
Clean system activity directory? [n]
Enable National Language Support (NLS)? [y]
Linux SMP race in serial driver workaround? [n] y
sa2 uses daily data file of previous day? [n] y
Number of daily data files to keep: [7] 31
Group for manual pages: [man]
Set crontab to start sar automatically? [n] y
Crontab owner (his crontab will be saved in current directory if necessary): [adm] root
按照以上配置即可,不要所有都选用默认配置。
配置后输出如下:
man directory is /usr/local/man
rc directory is /etc
init directory is /etc/init.d
#make
编辑当前路径下crontab文件,如下:
# Crontab sample for root or adm
# Please update this crontab with the proper location
# for sa1 and sa2 shell scripts (replace SA_LIB_DIR with
# /usr/lib/sa for example).
#
# 8am-7pm activity reports every 20 minutes during weekdays.
# 0 8-18 * * 1-5 /usr/local/lib/sa/sa1 -d 1200 3 &
# activity reports every 10 minutes everyday.
0 * * * * /usr/local/lib/sa/sa1 -d 600 6 &
#
# Activity reports every an hour on Saturday and Sunday.
# 0 * * * 0,6 /usr/local/lib/sa/sa1 -d &
#
# 7pm-8am activity reports every an hour during weekdays.
# 0 19-7 * * 1-5 /usr/local/lib/sa/sa1 -d &
#
# Daily summary prepared at 19:05.
# 5 19 * * 1-5 /usr/local/lib/sa/sa2 -A &
45 17 * * * /usr/local/lib/sa/sa2 -A &
#make install
安装完成
3. 检测
从文件检测,查看cron文件是否有记录,在/etc/cron.d/sysstat应有如下内容
# Run system activity accounting tool every 10 minutes
*/10 * * * * root /usr/local/lib/sa/sa1 -d 1 1
# 0 * * * * root /usr/local/lib/sa/sa1 -d 600 6 &
# Generate a daily summary of process accounting at 23:53
53 23 * * * root /usr/local/lib/sa/sa2 -A
从服务检测,直接运新sar -d ; sar -u 必须在配置后10分钟以后 |
|