Move /var/svc/log to /var/log/svc
[unleashed/lotheac.git] / share / man / man8 / sar.8
blobf1ae8336712b29ae9b24b7ca31b81e9c5e710a16
1 '\" te
2 .\"  Copyright 1989 AT&T Copyright (c) 2004, Sun Microsystems, Inc. All Rights Reserved
3 .\" 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.
4 .\" 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.
5 .\" 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]
6 .TH SAR 8 "May 13, 2017"
7 .SH NAME
8 sar, sa1, sa2, sadc \- system activity report package
9 .SH SYNOPSIS
10 .LP
11 .nf
12 \fB/usr/lib/sa/sadc\fR [\fIt\fR \fIn\fR] [\fIofile\fR]
13 .fi
15 .LP
16 .nf
17 \fB/usr/lib/sa/sa1\fR [\fIt\fR \fIn\fR]
18 .fi
20 .LP
21 .nf
22 \fB/usr/lib/sa/sa2\fR [\fB-aAbcdgkmpqruvwy\fR] [\fB-e\fR \fItime\fR] [\fB-f\fR \fIfilename\fR]
23      [\fB-i\fR \fIsec\fR] [\fB-s\fR \fItime\fR]
24 .fi
26 .SH DESCRIPTION
27 .LP
28 System activity data can be accessed at the special request of a user (see
29 \fBsar\fR(1)) and automatically, on a routine basis, as described here. The
30 operating system contains several counters that are incremented as various
31 system actions occur. These include counters for \fBCPU\fR utilization, buffer
32 usage, disk and tape \fBI/O\fR activity, \fBTTY\fR device activity, switching
33 and system-call activity, file-access, queue activity, inter-process
34 communications, and paging. For more general system statistics, use
35 \fBiostat\fR(8), \fBsar\fR(1), or \fBvmstat\fR(8).
36 .sp
37 .LP
38 \fBsadc\fR and two shell procedures, \fBsa1\fR and \fBsa2\fR, are used to
39 sample, save, and process this data.
40 .sp
41 .LP
42 \fBsadc\fR, the data collector, samples system data \fIn\fR times, with an
43 interval of \fIt\fR seconds between samples, and writes in binary format to
44 \fIofile\fR or to standard output. The sampling interval \fIt\fR should be
45 greater than 5 seconds; otherwise, the activity of \fBsadc\fR itself may affect
46 the sample. If \fIt\fR and \fIn\fR are omitted, a special record is written.
47 This facility can be used at system boot time, when booting to a multi-user
48 state, to mark the time at which the counters restart from zero. For example,
49 when accounting is enabled, the \fBsvc:/system/sar:default\fR service writes
50 the restart mark to the daily data file using the command entry:
51 .sp
52 .in +2
53 .nf
54 su sys -c "/usr/lib/sa/sadc /var/log/sa/sa\&'date +%d\&'"
55 .fi
56 .in -2
57 .sp
59 .sp
60 .LP
61 The shell script \fBsa1\fR, a variant of \fBsadc\fR, is used to collect and
62 store data in the binary file \fB/var/log/sa/sa\fR\fIdd,\fR where \fBdd\fR is
63 the current day. The arguments \fIt\fR and \fIn\fR cause records to be written
64 \fIn\fR times at an interval of \fIt\fR seconds, or once if omitted. The
65 following entries in \fB/var/spool/cron/crontabs/sys\fR will produce records
66 every 20 minutes during working hours and hourly otherwise:
67 .sp
68 .in +2
69 .nf
70 0 * * * 0-6 /usr/lib/sa/sa1
71 20,40 8\(mi17 * * 1\(mi5 /usr/lib/sa/sa1
72 .fi
73 .in -2
74 .sp
76 .sp
77 .LP
78 See \fBcrontab\fR(1) for details.
79 .sp
80 .LP
81 The shell script \fBsa2\fR, a variant of \fBsar\fR, writes a daily report in
82 the file \fB/var/log/sa/sar\fR\fIdd.\fR See the \fBOPTIONS\fR section in
83 \fBsar\fR(1) for an explanation of the various options. The following entry in
84 \fB/var/spool/cron/crontabs/sys\fR will report important activities hourly
85 during the working day:
86 .sp
87 .in +2
88 .nf
89 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
90 .fi
91 .in -2
92 .sp
94 .SH FILES
95 .ne 2
96 .na
97 \fB\fB/tmp/sa.adrfl\fR\fR
98 .ad
99 .sp .6
100 .RS 4n
101 address file
105 .ne 2
107 \fB\fB/var/log/sa/sa\fR\fBdd\fR\fR
109 .sp .6
110 .RS 4n
111 Daily data file
115 .ne 2
117 \fB\fB/var/log/sa/sar\fR\fBdd\fR\fR
119 .sp .6
120 .RS 4n
121 Daily report file
125 .ne 2
127 \fB\fB/var/spool/cron/crontabs/sys\fR\fR
129 .sp .6
130 .RS 4n
134 .SH SEE ALSO
136 \fBcrontab\fR(1), \fBsar\fR(1), \fBsvcs\fR(1), \fBtimex\fR(1),
137 \fBiostat\fR(8), \fBsvcadm\fR(8), \fBvmstat\fR(8), \fBattributes\fR(5),
138 \fBsmf\fR(5)
141 \fI\fR
142 .SH NOTES
144 The \fBsar\fR service is managed by the service management facility,
145 \fBsmf\fR(5), under the service identifier:
147 .in +2
149 svc:/system/sar
151 .in -2
156 Administrative actions on this service, such as enabling, disabling, or
157 requesting restart, can be performed using \fBsvcadm\fR(8). The service's
158 status can be queried using the \fBsvcs\fR(1) command.