'\" te .\" Copyright 1989 AT&T Copyright (c) 2004, Sun Microsystems, Inc. All Rights Reserved .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License. .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License. .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner] .TH SAR 8 "May 13, 2017" .SH NAME sar, sa1, sa2, sadc \- system activity report package .SH SYNOPSIS .LP .nf \fB/usr/lib/sa/sadc\fR [\fIt\fR \fIn\fR] [\fIofile\fR] .fi .LP .nf \fB/usr/lib/sa/sa1\fR [\fIt\fR \fIn\fR] .fi .LP .nf \fB/usr/lib/sa/sa2\fR [\fB-aAbcdgkmpqruvwy\fR] [\fB-e\fR \fItime\fR] [\fB-f\fR \fIfilename\fR] [\fB-i\fR \fIsec\fR] [\fB-s\fR \fItime\fR] .fi .SH DESCRIPTION .LP System activity data can be accessed at the special request of a user (see \fBsar\fR(1)) and automatically, on a routine basis, as described here. The operating system contains several counters that are incremented as various system actions occur. These include counters for \fBCPU\fR utilization, buffer usage, disk and tape \fBI/O\fR activity, \fBTTY\fR device activity, switching and system-call activity, file-access, queue activity, inter-process communications, and paging. For more general system statistics, use \fBiostat\fR(8), \fBsar\fR(1), or \fBvmstat\fR(8). .sp .LP \fBsadc\fR and two shell procedures, \fBsa1\fR and \fBsa2\fR, are used to sample, save, and process this data. .sp .LP \fBsadc\fR, the data collector, samples system data \fIn\fR times, with an interval of \fIt\fR seconds between samples, and writes in binary format to \fIofile\fR or to standard output. The sampling interval \fIt\fR should be greater than 5 seconds; otherwise, the activity of \fBsadc\fR itself may affect the sample. If \fIt\fR and \fIn\fR are omitted, a special record is written. This facility can be used at system boot time, when booting to a multi-user state, to mark the time at which the counters restart from zero. For example, when accounting is enabled, the \fBsvc:/system/sar:default\fR service writes the restart mark to the daily data file using the command entry: .sp .in +2 .nf su sys -c "/usr/lib/sa/sadc /var/adm/sa/sa\&'date +%d\&'" .fi .in -2 .sp .sp .LP The shell script \fBsa1\fR, a variant of \fBsadc\fR, is used to collect and store data in the binary file \fB/var/adm/sa/sa\fR\fIdd,\fR where \fBdd\fR is the current day. The arguments \fIt\fR and \fIn\fR cause records to be written \fIn\fR times at an interval of \fIt\fR seconds, or once if omitted. The following entries in \fB/var/spool/cron/crontabs/sys\fR will produce records every 20 minutes during working hours and hourly otherwise: .sp .in +2 .nf 0 * * * 0-6 /usr/lib/sa/sa1 20,40 8\(mi17 * * 1\(mi5 /usr/lib/sa/sa1 .fi .in -2 .sp .sp .LP See \fBcrontab\fR(1) for details. .sp .LP The shell script \fBsa2\fR, a variant of \fBsar\fR, writes a daily report in the file \fB/var/adm/sa/sar\fR\fIdd.\fR See the \fBOPTIONS\fR section in \fBsar\fR(1) for an explanation of the various options. The following entry in \fB/var/spool/cron/crontabs/sys\fR will report important activities hourly during the working day: .sp .in +2 .nf 5 18 * * 1\(mi5 /usr/lib/sa/sa2 \fB-s\fR 8:00 \fB-e\fR 18:01 \fB-i\fR 1200 \fB-A\fR .fi .in -2 .sp .SH FILES .ne 2 .na \fB\fB/tmp/sa.adrfl\fR\fR .ad .sp .6 .RS 4n address file .RE .sp .ne 2 .na \fB\fB/var/adm/sa/sa\fR\fBdd\fR\fR .ad .sp .6 .RS 4n Daily data file .RE .sp .ne 2 .na \fB\fB/var/adm/sa/sar\fR\fBdd\fR\fR .ad .sp .6 .RS 4n Daily report file .RE .sp .ne 2 .na \fB\fB/var/spool/cron/crontabs/sys\fR\fR .ad .sp .6 .RS 4n .RE .SH SEE ALSO .LP .BR crontab (1), .BR sar (1), .BR svcs (1), .BR timex (1), .BR attributes (7), .BR smf (7), .BR iostat (8), .BR svcadm (8), .BR vmstat (8) .sp .LP \fI\fR .SH NOTES .LP The \fBsar\fR service is managed by the service management facility, \fBsmf\fR(7), under the service identifier: .sp .in +2 .nf svc:/system/sar .fi .in -2 .sp .sp .LP Administrative actions on this service, such as enabling, disabling, or requesting restart, can be performed using \fBsvcadm\fR(8). The service's status can be queried using the \fBsvcs\fR(1) command.