sar

Overview

System activity reporting tool that records system performance statistics to a file.

Usage Guide

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.
-i %gt;Statistics for a specified interrupt.
-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.

Tool Data

Operating Platform:Linux
Diagnostic Target:OS - Performance Monitoring
Tool Executable:sar
Obtain From:Included in the sysstat tools package. Available from most package managers (eg. apt, RPM, portage)

Results for Tools search

You entered the search string "".
No results were returned for this string.

Copyright © 1997 - 2016 Mission Pacific Pty Ltd. All rights reserved. ezcom, the ez logo and hard tech cafe are registered trademarks of Mission Pacific Pty Ltd. Designed for firefox and safari. Sitemap