System Administration Guide: Advanced Administration

How to Set Up Automatic Data Collection

  1. Become superuser.

  2. Edit the /etc/init.d/perf file and uncomment the following lines:


    # if [ -z "$_INIT_RUN_LEVEL" ]; then
    #       set -- `/usr/bin/who -r`
    #       _INIT_RUN_LEVEL="$7"
    #       _INIT_RUN_NPREV="$8"
    #       _INIT_PREV_LEVEL="$9"
    # fi
    # 
    # if [ $_INIT_RUN_LEVEL -ge 2 -a $_INIT_RUN_LEVEL -le 4 -a \
    #     $_INIT_RUN_NPREV -eq 0 -a \( $_INIT_PREV_LEVEL = 1 -o \
    #     $_INIT_PREV_LEVEL = S \) ]; then
    # 
    #       /usr/bin/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).

  3. Edit the /var/spool/cron/crontabs/sys crontab file and uncomment the following lines:


    # 0 * * * 0-6 /usr/lib/sa/sa1
    # 20,40 8-17 * * 1-5 /usr/lib/sa/sa1
    # 5 18 * * 1-5 /usr/lib/sa/sa2 -s 8:00 -e 18:01 -i 1200 -A