To record system activity every t seconds for n intervals and save this data to sar_data, enter sar -o datafile t n on a single processor system, or mpsar -o datafile t n on a multiprocessor system.
For example, to collect data every 60 seconds for 10 minutes into
the file /tmp/sar_data on a single CPU
machine, you would enter:
sar -o /tmp/sar_data 60 10
To examine the data from datafile, the
sar [ option ... ] [ -f datafile ]
mpsar [ option ... ] [ -f datafile ]
cpusar [ option ... ] [ -f datafile ]
Each option specifies the aspect of system activity
that you want to examine.
datafile is the
name of the file that contains the statistics you want to view.
For example, to view the sar -v report for
the tenth day of the most recent month, enter:
sar -v -f /usr/adm/sa/sa10
You can also run sar to view system activity in ``real time''
rather than examining previously collected data.
To do this, specify the sampling interval in seconds followed by the
number of repetitions required.
For example, to take 20 samples at an interval of 15 seconds, enter:
sar -v 15 20
As shipped, the system allows any user to run sar in real time. However, the files in the /usr/adm/sa directory are readable only by root. You must change the permissions on the files in that directory if you want other users to be able to access sar data.
With certain options, if there is no information to display in any of the relevant fields after a specified time interval then a time stamp will be the only output to the screen. In all other cases zeros are displayed under each relevant column.
When tuning your system, we recommend that you use a benchmark and have the system under normal load for your application.