System Administration Guide

How to Set Up Automatic Data Collection

  1. Become superuser.

  2. Using the editor of your choice, open the /etc/init.d/perf file, which contains the sadc start-up instructions. Verify that the following lines are uncommented:


    MATCH=`who -r|grep -c "[234][		 ]*0[	 ]*[S1]"`  if [ ${MATCH} -eq 1 ]
    then su sys -c "/usr/lib/sa/sadc /var/adm/sa/sa`date +%d`"  fi

    This version of the sadc command writes a special record that marks the time when the counters are reset to zero (boot time). The sadc output is put into the file sadd (where dd is the current date), which acts as the daily system activity record.

  3. Using the editor of your choice, open the /var/spool/cron/crontabs/sys file (the system crontab file). Uncomment the following lines:


    # 0 * * * 0-6 /usr/lib/sa/sa1
    # 20,40 8-17 * * 1-5 /usr/lib/sa/sa1

    The first entry writes a record to /var/adm/sa/sadd on the hour, every hour, seven days a week.

    The second entry writes a record to /var/adm/sa/sadd twice each hour during peak working hours: at 20 minutes and 40 minutes past the hour, from 8 a.m. to 5 p.m., Monday through Friday.

    Thus, these two crontab entries cause a record to be written to /var/adm/sa/sadd every 20 minutes from 8 a.m. to 5 p.m., Monday through Friday, and every hour on the hour otherwise. You can change these defaults to meet your needs.