HP-UX Reference (11i v1 00/12) - 1M System Administration Commands N-Z (vol 4)
__________________________________________________________________________________________________________________________________________________________________________________________________
__________________________________________________________________________________________________________________________________________________________________________________________________
STANDARD Printed by: Nora Chuang [nchuang] STANDARD
/build/1111/BRICK/man1m/naaagt.1m
________________________________________________________________
___ ___
s
sa1(1M) sa1(1M)
NAME
sa1, sa2, sadc - system activity report package
SYNOPSIS
/usr/lbin/sa/sa1 [tn]
/usr/lbin/sa/sa2 [-ubdycwaqvmA ][-s time ][-e time][-i sec]
/usr/lbin/sa/sadc [tn][ofile]
DESCRIPTION
System activity data can be accessed at the special request of a user (see sar(1)) and automatically on a rou-
tine basis as described here. The operating system contains a number of counters that are incremented as
various system actions occur. These include CPU utilization counters, buffer usage counters, disk and tape
I/O activity counters, tty device activity counters, switching and system-call counters, file-access counters,
queue activity counters, and counters for inter-process communications.
sadc and shell procedures sa1 and sa2 are used to sample, save, and process this data.
sadc, the data collector, samples system data n times every t seconds and writes in binary format to ofile
or to standard output. If t and n are omitted, a special record is written. This facility is used at system
boot time to mark the time at which the counters restart from zero. Executing the following command in a
system startup script:
/usr/lbin/sa/sadc /var/adm/sa/sa‘date +%d‘
writes the special record to the daily data file to mark the system restart. Instructions for creating system
startup scripts may be found in the 10.0 File System Layout White Paper, which is online in file
/usr/share/doc/filesys.ps
.
The shell script
sa1, a variant of sadc, is used to collect and store data in binary file
/var/adm/sa/sadd where dd is the current day. The arguments t and n cause records to be written n
times at an interval of t seconds, or once if omitted. The following entries, if placed in
crontab, produce
records every 20 minutes during working hours and hourly otherwise (see cron(1M)):
0 * * * 0,6 /usr/lbin/sa/sa1
0 8-17 * * 1-5 /usr/lbin/sa/sa1 1200 3
0 18-7 * * 1-5 /usr/lbin/sa/sa1
The shell script sa2, a variant of sar, writes a daily report in file /var/adm/sa/sar
dd. The options
are explained in sar(1). The following
crontab entry reports important activities hourly during the
working day:
5 18 * * 1-5 /usr/lbin/sa/sa2 -s 8:00 -e 18:01 -i 3600 -A
The structure of the binary daily data file is:
struct sa {
struct sysinfo si; /* see /usr/include/sys/sysinfo.h */
int sztext; /* current entries of text table */
int szinode; /* current entries of inode table */
int szfile; /* current entries of file table */
int szproc; /* current entries of proc table */
int msztext; /* size of text table */
int mszinode; /* size of inode table */
int mszfile; /* size of file table */
int mszproc; /* size of proc table */
long textovf; /* cumul. overflows of text table */
long inodeovf; /* cumul. overflows of inode table */
long fileovf; /* cumul. overflows of file table */
long procovf; /* cumul. overflows of proc table */
time_t ts; /* time stamp, seconds */
long devio[NDEVS][4]; /* device info for up to NDEVS units */
#define IO_OPS 0 /* cumul. I/O requests */
#define IO_BCNT 1 /* cumul. blocks transferred */
#define IO_ACT 2 /* cumul. drive busy time in ticks */
#define IO_RESP 3 /* cumul. I/O resp time in ticks */
};
HP-UX Release 11i: December 2000 − 1 − Section 1M−−749
___
___