xref: /titanic_41/usr/src/cmd/sa/README (revision eb0cc229f19c437a6b538d3ac0d0443268290b7e)
1#
2# CDDL HEADER START
3#
4# The contents of this file are subject to the terms of the
5# Common Development and Distribution License, Version 1.0 only
6# (the "License").  You may not use this file except in compliance
7# with the License.
8#
9# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10# or http://www.opensolaris.org/os/licensing.
11# See the License for the specific language governing permissions
12# and limitations under the License.
13#
14# When distributing Covered Code, include this CDDL HEADER in each
15# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16# If applicable, add the following below this CDDL HEADER, with the
17# fields enclosed by brackets "[]" replaced with your own identifying
18# information: Portions Copyright [yyyy] [name of copyright owner]
19#
20# CDDL HEADER END
21#
22
23 Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
24 Use is subject to license terms.
25
26ident	"%Z%%M%	%I%	%E% SMI"
27
28README 1.9 of 5/8/89
29
30Instruction of daily report generation:
31
321.  The line
33
34    /usr/lib/sa/sadc /var/adm/sa/sa`date +%d`
35
36    is executed by the start method for the system/sar:default service,
37    if enabled
38
39    sadc is executed once, such that a special record is written to
40    the daily data file when UNIX restarts.
41
422.  The execution of shell script
43    sa1 [t n]
44    causes data collection program to write system activity
45    counters n times at every t-second interval on data file.
46    If t and n are not specified, it writes data once.
47    According to your installation's requirement, enter
48    entries of executing  sa1 [t n] in /var/spool/cron/crontabs/sys
49    to collect system activity data.
50    For example, entries
51
52    0 8-17 * * 1-5 su sys -c "/usr/lib/sa/sa1 1200 3 &" and
53    0 18-23 * * 1-5 su sys -c "/usr/lib/sa/sa1 &"
54
55    cause data collection program to be activated at every hour
56    on the hour from 8:00 to 23:00 on weekdays.
57    Moreover, It writes data on data file 3 times at every 20
58    minutes interval from 8:00 to 17:00 and once at other times.
59
603.  Shell procedure sa2 will invoke sar command to generate
61    the daily report from the data file.  Its usage is
62
63    sa2 [-options] [-s hh:mm] [-e hh:mm] [-i ss]
64
65    where -s and -e specify the report starting and ending times
66    respectively, -i specifies the report data interval in seconds.
67    If they are not specified, all data from the data file are to
68    be reported.  -options are report options, see manual page
69    sar.1 for description.
70
71    Make an entry to execute sa2 in /var/spool/cron/crontabs.
72    For instance, entry
73
74    5 18 * * 1-5 su adm -c "/usr/lib/sa/sa2 -s 8:00 -e 18:01 -i 3600
75    -ubd &"
76
77    causes the invocation of sar command at 18:05.  It generates
78    the daily report that includes the hourly cpu utilization,
79    buffer usage and disk and tape  activities from 8:00 to 18:01.
80