Technical article 125347

How does sar work and how can I increase the number of days information is stored?

OpenServer 5.0.0OpenServer 5.0.2OpenServer 5.0.4OpenServer 5.0.5OpenServer 5.0.6OpenServer 5.0.7UnixWare 7.0.0UnixWare 7.0.1UnixWare 7.1.0UnixWare 7.1.1UnixWare 7.1.2UnixWare 7.1.3UnixWare 7.1.4Open UNIX 8

Written · Last revised

Problem

sar by default collects system performance data for 8 days
only. I want to understand what scripts are associated
with sar, what they do and how I can perhaps collect more
than 8 days of data.

Solution

sar is the System Activity Reporting tool. It collects raw
system performance data and reports this in human readable
form.

OpenServer sar can be enabled manually by issuing "/usr/lib/sa/sar_enable -y" command. Unixware automatically runs sar by default.

The scripts associated with sar are /usr/lib/sa/sa1 and sa2.

sar keeps collecting data constantly, and samples it via
the sa1 script scheduled in sys crontab.

/usr/lib/sa/sa1 calls /usr/lib/sa/sadc (every 20 minutes between 0800 and 1700 by default) to collect raw system performance related data. Data is captured pertaining to hard disks, memory and cpu performance. This raw data is captured to a daily data file which is saved as /var/adm/sa/saXX where XX are the digits representing the day of the month.

It is the /usr/lib/sa/sa2 script in OpenServer's root
crontab and UnixWare's root crontab that produces the
human readable report. This scheduled to run daily via sys
or root's crontab respectively.

You'll also note that the sa2 script has the following line which removes all data directories over seven days old.

find /var/adm/sa \( -name 'sar*' -o -name 'sa*' \) -mtime
+7 -exec rm {} \;

If you wanted to keep 15 days of data, simply change the "+7" above to "+14".

See also

SCO Reference manual or scohelp online man pages:

sar_enable(ADM), sadc(ADM), sa1(ADM), sa2(ADM), sar(ADM)

TA116222 "How do I quickly determine the cause of a performance problem?"

From the Xinuos technical article database, record 125347. Reproduced with permission. The original is at www.sco.com/ta/125347, which is reachable but blocked from search engines.

Next step

Need this fixed rather than explained?

Tell us the release, what the system runs and what it is doing. We will reply by email with what we would do next.

  • You deal with the people who do the work
  • No obligation, and no upgrade required before we will help
  • We tell you plainly if something is not worth doing

Send an enquiry

We reply by email. If a server is down, say so in the first line. You can also write to help@scoexpert.com.