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
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.
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]
23 Copyright 2004 Sun Microsystems, Inc. All rights reserved.
24 Use is subject to license terms.
26 ident "%Z%%M% %I% %E% SMI"
30 Instruction of daily report generation:
34 /usr/lib/sa/sadc /var/adm/sa/sa`date +%d`
36 is executed by the start method for the system/sar:default service,
39 sadc is executed once, such that a special record is written to
40 the daily data file when UNIX restarts.
42 2. The execution of shell script
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.
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 &"
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.
60 3. Shell procedure sa2 will invoke sar command to generate
61 the daily report from the data file. Its usage is
63 sa2 [-options] [-s hh:mm] [-e hh:mm] [-i ss]
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.
71 Make an entry to execute sa2 in /var/spool/cron/crontabs.
74 5 18 * * 1-5 su adm -c "/usr/lib/sa/sa2 -s 8:00 -e 18:01 -i 3600
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.