Fetching directory, one moment please ...
System activity reporting tool that records system performance statistics to a file.
This utility captures performance statistics specified on the command line and writes them to a nominated file. If no performance statistics are specified, sar captures CPU data. The format of the command is:
sar -o <filename> <capture_interval_in_seconds> <n_times_to_capture>
This example captures all network statistics 10 times at 30 second intervals and writes them to a file called /var/log/sysstat/sa-custom-01:
sar -n ALL -o /var/log/sysstat/sa-custom-01 30 10
These are the performance statistics that can be requested:
-b Transfer rates for physical disks.
-B Paging statistics.
-c Tasks created per second.
-d Block device (disk) statistics.
-n < DEV / EDEV / NFS / NFSD / SOCK / ALL> Network statistics.
-P <cpu_number / ALL> Statistics for specified CPU or individual data for each CPU.
-q Queue length and load averages.
-r Memory and swap space statistics.
-R Memory statistics.
-u CPU utilisation.
-v Inode, file and other kernel tables status.
-w Context switches
-W Swapping statistics.
-y tty activity.
sar comes with a script to manage ongoing daily data capture. The script is called /usr/lib/sysstat/sa1. By default, sa1 writes performance data to /var/log/sysstat/sadd, where dd is the day part of today's date. sa1 is best configured as a job on a crontab, but can be run from the command line:
/usr/lib/sysstat/sa1 600 3 Captures data every 10 minutes
Performance data is written to a binary file and this can be accessed by running sar with a flag to specify the desired statistics, eg
sar -R Displays memory statistics from today's log file.
Adding the -f parameter with a filename will cause sar to display statistics from that file. This is useful to view data from historical log files. eg
sar -f /var/log/sysstat/sa14 -R Displays memory data from the 14th of this month.
|Diagnostic Target:||OS - Performance Monitoring|
|Obtain From:||Included in the sysstat tools package. Available from most package managers (eg. apt, RPM, portage)|