Jump to content United States-English
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
More options
HP.com home
HP-UX Reference > S

sa1(1M)

HP-UX 11i Version 3: February 2007
» 

Technical documentation

» Feedback
Content starts here

 » Table of Contents

 » Index

NAME

sa1, sa2, sadc — system activity report package

SYNOPSIS

/usr/lbin/sa/sa1 [t n]

/usr/lbin/sa/sa2 [-aAbcdLHmqtuvwy] [-s time] [-e time] [-i sec]

/usr/lbin/sa/sadc [t n] [ofile]

DESCRIPTION

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, activity counters for disk, lunpath, HBA, tape I/O, and tty devices, 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 on http://docs.hp.com.

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:

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 { 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 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 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 transfers */ 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 */ unsigned long readch; /* characters transferred by read 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 primitive */ 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 */ unsigned long elements_in_use; long elements[20]; };

WARNINGS

This structure can change in future releases, with no support for backward compatibility.

FILES

/tmp/sa.adrfl

address file

/var/adm/sa/sadd

daily data file

/var/adm/sa/sardd

daily report file

SEE ALSO

timex(1), cron(1M), sar(1M), intro(7).

10.0 File System Layout White Paper on http://docs.hp.com.

STANDARDS CONFORMANCE

sa1: SVID2, SVID3

sa2: SVID2, SVID3

sadc: SVID2, SVID3

Printable version
Privacy statement Using this site means you accept its terms Feedback to webmaster
© 1983-2007 Hewlett-Packard Development Company, L.P.