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