How to set up sar


The following instructions are designed to help you set up sar for data collection using the traditional data collection intervals. If you run a 24x7 shop or have other reasons for changing the sampling times and intervals, please understand that this is only meant to be a starting point. These instructions assume that you have a reasonable amount of knowledge about system administration.

* SCO OpenServer Release 5 * HP-UX 9.x * HP-UX 10.x * HP-UX 11.x * Solaris 2.5+ *


SCO OpenServer Release 5:

Use the following command to enable sar:

/usr/lib/sa/sar_enable -y

more information can be found on the sar_enable man page, or if you have any questions or problems, contact us!

HP-UX 9.x (800 series only):

First, make sure the /usr/adm/sa directory exists, and make it if it doesn’t.

Here are some recommended cron entries. These entries will capture data once an hour at non-peak times and every 20 minutes during the system’s busiest times. Feel free to modify these entries to best capture statistics from your system’s busiest times. We recommend capturing sar data every 10 to 60 minutes. Add these to your /usr/spool/cron/crontabs/root file using SAM:

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

In some cases, it may be necessary to reboot the system. If you have any questions or problems, contact us!

HP-UX 10.x:

First, make sure the /var/adm/sa directory exists, and make it if it doesn’t.

Here are some recommended cron entries. These entries will capture data once an hour at non-peak times and every 20 minutes during the system’s busiest times. Feel free to modify these entries to best capture statistics from your system’s busiest times. We recommend capturing sar data every 10 to 60 minutes. Add these to your /usr/spool/cron/crontabs/root file using SAM or crontab -e, and if you're using crontab, type them exactly as seen:

#collect sar data
0 * * * * /usr/lbin/sa/sa1
20,40 8-17 * * 1-5 /usr/lbin/sa/sa1
#reduce the sar data
5 18 * * * /usr/lbin/sa/sa2 -s 8:00 -e 18:01 -i 1200 -A

In some cases, it may be necessary to reboot the system. If you have any questions or problems, contact us!

 

HP-UX 11.x:

First, make sure the /var/adm/sa directory exists, and make it if it doesn’t.

Here are some recommended cron entries. These entries will capture data once an hour at non-peak times and every 20 minutes during the system’s busiest times. Feel free to modify these entries to best capture statistics from your system’s busiest times. We recommend capturing sar data every 10 to 60 minutes. Add these to your /usr/spool/cron/crontabs/root file using SAM or crontab -e, and if you're using crontab, type them exactly as seen:

#collect sar data
0 * * * * /usr/lbin/sa/sa1
20,40 8-17 * * 1-5 /usr/lbin/sa/sa1
#reduce the sar data
5 18 * * * /usr/lbin/sa/sa2 -s 8:00 -e 18:01 -i 1200 -A

NOTE: We believe we've found a bug in the HP-UX 11.00 implementation of sar that prevents the -s switch from working. If the above crontab entries do not produce /var/adm/sa/sar* files or you get mail messgaes with the strange error message "sar: Starting time must be more than ending time", try changing crontab entry for running sa2 to the following:

#reduce the sar data
5 18 * * * /usr/lbin/sa/sa2 -A

If it's important to have starting and ending times defined in your sar reports, you'll have to adjust the crontab entries for running the /usr/lbin/sa/sa1 script.

If you have any questions or problems, contact us!

Solaris 2.5 and up:

First, make sure the /var/adm/sa directory exists, and make it if it doesn’t.

Next, make sure the SUNWaccu and SUNWaccr packages are installed.

Finally, su as sys, and use crontab -e to uncomment the 3 lines in crontab which run the /usr/lib/sa/sa1 and /usr/lib/sa/sa2 scripts. If those lines aren’t there, add these 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

If you have any questions or problems, contact us!

Back to the SarCheck home page

Copyright © 1998 Aurora Software Inc., All rights reserved.
Information in this document is subject to change without notice.
Other products and companies referred to herein are trademarks or registered trademarks of their respective companies or mark holders.
This page last updated on January 26, 1998.