sa1(1M) sa1(1M)
NAME [Toc] [Back]
sa1, sa2, sadc - system activity report package
SYNOPSIS [Toc] [Back]
/usr/lbin/sa/sa1 [t n]
/usr/lbin/sa/sa2 [-ubdycwaqvmA] [-s time] [-e time] [-i sec]
/usr/lbin/sa/sadc [t n] [ofile]
DESCRIPTION [Toc] [Back]
System activity data can be accessed at the special request of a user
(see sar(1M)) and automatically on a routine 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/sardd. The options are explained in sar(1M). The
following crontab entry reports important activities hourly during the
working day:
Hewlett-Packard Company - 1 - HP-UX 11i Version 2: August 2003
sa1(1M) sa1(1M)
5 18 * * 1-5 /usr/lbin/sa/sa2 -s 8:00 -e 18:01 -i 3600 -A
Structure of the binary daily data file lists information about the
active processors. The structure of the binary daily data file is:
struct sa {
unsigned long version[PST_MAX_CPUSTATES]; /* sadd file version */
psetid_t psetid[SAR_MAX_PROCS][2]; /* mapping of psetid
and cpus in the
system */
int cpus[SAR_MAX_PROCS]; /* Active processors list */
unsigned long cpu [PST_MAX_CPUSTATES]; /* Average time spent in
each state */
unsigned long mp_cpu [SAR_MAX_PROCS][PST_MAX_CPUSTATES]; /* per proc
cpu time */
unsigned long proc_cnt; /* MP: number of active processors */
unsigned long max_proc_cnt; /* MP: max active processors */
unsigned long ndrives; /* Number of drives */
unsigned long bread; /* Transfer of data between system
buffers and disk or other block devices */
unsigned long bwrite;
unsigned long lread; /* Access of system buffers */
unsigned long lwrite;
unsigned long phread; /* Transfer via physical device mechanism */
unsigned long phwrite;
unsigned long swapin; /* Number of swap transfer */
unsigned long swapout;
unsigned long bswapin; /* Number of 512-bytes transferred
(for bswapin:include initial loading
of some programs */
unsigned long bswapout;
unsigned long pswitch; /* process switches */
unsigned long syscall; /* system calls of all types */
unsigned long sysread; /* specific system calls */
unsigned long syswrite; /* Number of write() system calls */
unsigned long sysfork; /* Number of fork() system calls */
unsigned long sysexec; /* Number of exec() system calls */
unsigned long runque; /* run queue of processes in memory
and runable */
unsigned long runocc; /* time occurring */
unsigned long mp_runque [SAR_MAX_PROCS];
unsigned long mp_runocc [SAR_MAX_PROCS];
unsigned long swpque; /* swap queue of processes swapped out
but ready to run. */
unsigned long swpocc;
unsigned long iget; /* use of file access system routines */
unsigned long namei;
unsigned long dirblk; /* Number of directory blocks encountered */
Hewlett-Packard Company - 2 - HP-UX 11i Version 2: August 2003
sa1(1M) sa1(1M)
unsigned long readch; /* characters transferred by read/write
system calls */
unsigned long writech; /* characters transferred by write
system calls */
unsigned long rcvint; /* receive interrupt */
unsigned long xmtint; /* transfer interrupt */
unsigned long mdmint; /* modem interrupt */
unsigned long rawch; /* input character */
unsigned long canch; /* input character processed by
cannon */
unsigned long outch; /* output character */
unsigned long msg; /* message primitve */
unsigned long sema; /* semaphore primitive */
unsigned long select; /* select system calls */
unsigned int sztext; /* current size of text table */
unsigned int szinode; /* current size of inode table */
unsigned int szfile; /* current size of file table */
unsigned int szproc; /* current size of proc table */
unsigned int msztext; /* maximum size of text table */
unsigned int mszinode; /* maximum size of inode table */
unsigned int mszfile; /* maximum size of file table */
unsigned int mszproc; /* maximum size of proc table */
unsigned long inodeovf; /* cumulative overflows of inode table
since boot */
unsigned long fileovf; /* cumulative overflows of file table
since boot */
unsigned long procovf; /* cumulative overflows of proc table
since boot */
time_t ts; /* time stamp */
};
FILES [Toc] [Back]
/tmp/sa.adrfl address file
/var/adm/sa/sadd daily data file
/var/adm/sa/sardd daily report file
SEE ALSO [Toc] [Back]
cron(1M), sar(1M), timex(1).
STANDARDS CONFORMANCE [Toc] [Back]
sa1: SVID2, SVID3
sa2: SVID2, SVID3
sadc: SVID2, SVID3
Hewlett-Packard Company - 3 - HP-UX 11i Version 2: August 2003 [ Back ] |