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?"