7. Using Monitoring and Tracing Tools : Operating System Utilities : UNIX Operating System Utilities : sar (System V)
 
Share this page                  
sar (System V)
The sar (System Activity Reporter) command can be used to list CPU utilization statistics, disk and swapping activity, and other status options. The UNIX sar command samples cumulative activity counters in the operating system and reports on various system activities. Just a few of the reports available that are of use for the system administrator are CPU utilization, disk activity, and swapping activity. See examples below.
There are many other options available, including reports on unused memory pages and disk blocks (swap space), and message activity. For the system administrator, sar is an indispensable tool.
The command sar -u 5, shows CPU utilization output as in the following sample output:
06:38:26   %usr   %sys   %wio   %idle
06:38:31      1      3     96       0
This output shows the portion of CPU time spent running in user mode, system mode, idle with some process waiting for block I/O, or otherwise idle.
The command sar -d 5, shows disk activity output as in the following sample output:
06:39:53  device   %busy   avque   r+w /s   blks/s   avwait   avserv
06:39:53  disc0-0     16    13.6        6       17    349.6     29.7
          disc0-5      0     1.0        0        2      0.0     20.0
The display shows the portion of time the device was busy servicing requests (%busy), the average number of outstanding requests (avque), the number of data transfers (r+w/s), the number of bytes transferred in 512-byte units (blk/s), the average time in milliseconds that requests wait idly on queue (avwait), and the average time for requests to be serviced (avserve).
The command sar -w 5 shows swapping activity output as in the following sample output:
06:40:45   swpin/s   bswin/s  swpot/s   bswot/s   pswch/s
06:40:50      0.00       0.0     0.00       0.0        19
The fields swpin/s, swpot/s are the number of swap transfers. The fields bswin/s, bswot/s are the number of 512-byte units transferred in/out. The field pswch/s is the number of process switches.