System Administration Guide: Advanced Administration

Setting Up Automatic Data Collection (sar)

The sar command can be used either to gather system activity data itself or to report what has been collected in the daily activity files that are created by the sadc command.

The sar command has the following formats:

sar [-aAbcdgkmpqruvwy] [-o file] t [n] 

sar [-aAbcdgkmpqruvwy] [-s time] [-e time] [-i sec] [-f file]

The following sar command samples cumulative activity counters in the operating system every t seconds, n times. The t should be five seconds or greater. Otherwise, the command itself might affect the sample. You must specify a time interval in which to take the samples. Otherwise, the command operates according to the second format. The default value of n is 1. The following example takes two samples separated by 10 seconds. If the -o option were specified, samples are saved in binary format.

$ sar -u 10 2

Other important information about the sar command includes the following:

The following table lists the sar options and their actions.

Table 13–2 Options for the sar Command




Checks file access operations 


Checks buffer activity  


Checks system calls  


Checks activity for each block device 


Checks page-out and memory freeing  


Checks kernel memory allocation  


Checks interprocess communication  


Checks system table status  


Checks swap and dispatch activity  


Checks queue activity  


Checks unused memory  


Checks CPU utilization 


Checks swapping and switching volume  


Checks terminal activity  


Reports overall system performance, which is the same as entering all options. 

Using no option is equivalent to calling the sar command with the -u option.