sar(1M) DG/UX 5.4.2 sar(1M)
NAME
sar: sa1, sa2, sadc - system activity report package
SYNOPSIS
/usr/lib/sa/sadc [t n] [ofile]
/usr/lib/sa/sa1 [t n]
/usr/lib/sa/sa2 [-ubdycwaqvmprA] [-s time] [-e time] [-i sec]
DESCRIPTION
Sar(1M) accesses system activity data automatically on a routine
basis. Such data can also be accessed at the special request of a
user through sar(1). 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 the shell procedures sa1 and sa2 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. The /etc/init.d/rc.account entry:
su sys -c "/usr/lib/sa/sadc /usr/adm/sa/sa`date +%d`"
writes the special record to the daily data file to mark the system
restart.
The shell script sa1, a variant of sadc, collects and stores data in
binary file /usr/adm/sa/sadd (dd is the current day). The arguments
t and n write records n times at an interval of t seconds; the
default is to write once. The following crontab [see cron(1M)]
entries will produce records every 20 minutes during working hours
and hourly otherwise:
0 * * * 0,6 su - sys -c "/usr/lib/sa/sa1"
0 8-17 * * 1-5 su sys -c "/usr/lib/sa/sa1 1200 3"
0 18-7 * * 1-5 su sys -c "/usr/lib/sa/sa1"
The shell script sa2, a variant of sar(1), writes a daily report in
file /usr/adm/sa/sardd. The options are explained in sar(1). The
crontab entry:
5 18 * * 1-5 su adm -c "/usr/lib/sa/sa2 -s 8:00 -e 18:01 -i 3600 -A"
reports important activities hourly during the working day.
Licensed material--property of copyright holder(s) 1
sar(1M) DG/UX 5.4.2 sar(1M)
The binary data file consists of a tblmap structure followed by a
series of sa structures, defined as follows:
struct tblmap {
char samagic[4]; /* a magic "number" */
short sarevision; /* a version id */
char sasysname[12];/*from monitored system's uname struct*/
char sanodename[12];
char sarelease[24];
char saversion[24];
char samachine[24];
int sahertz; /* monitored system's hertz value */
char devnm[NDEVS][25]; /* device names */
} tblmap;
#define SAMAGIC "sar"
#define SAVERSION 0430
struct sysinfo {
timet cpu[5];
#define CPUIDLE 0
#define CPUUSER 1
#define CPUKERNEL 2
#define CPUWAIT 3
#define CPUSXBRK 4
timet wait[3];
#define WIO 0
#define WSWAP 1
#define WPIO 2
unsigned long bread;
unsigned long bwrite;
unsigned long lread;
unsigned long lwrite;
unsigned long phread;
unsigned long phwrite;
unsigned long swapin;
unsigned long swapout;
unsigned long bswapin;
unsigned long bswapout;
unsigned long pswitch;
unsigned long syscall;
unsigned long sysread;
unsigned long syswrite;
unsigned long sysfork;
unsigned long sysexec;
unsigned long runque;
unsigned long runocc;
unsigned long swpque;
unsigned long swpocc;
unsigned long iget;
unsigned long namei;
unsigned long dirblk;
unsigned long readch;
unsigned long writech;
unsigned long rcvint;
Licensed material--property of copyright holder(s) 2
sar(1M) DG/UX 5.4.2 sar(1M)
unsigned long xmtint;
unsigned long mdmint;
unsigned long rawch;
unsigned long canch;
unsigned long outch;
unsigned long msg;
unsigned long sema;
unsigned long pnpfault;
unsigned long wrtfault;
};
struct minfo {
unsigned long freemem;
unsigned long freeswap;
unsigned long vfault;
unsigned long pfault;
unsigned long file;
unsigned long freedpgs;
};
struct dinfo {
timet serve;
};
struct sa {
struct sysinfo si; /* system statistics */
struct minfo mi; /* memory and paging statistics */
struct dinfo di; /* (not used) */
unsigned int minserve; /* (not used) */
unsigned int maxserve; /* (not used) */
unsigned int szinode; /* current entries of inode table */
unsigned int szfile; /* current entries of file table */
unsigned int szproc; /* current entries of proc table */
unsigned int szlckf; /* cur size of file record hdr. table*/
unsigned int szlckr; /* cur size of file record lock table*/
unsigned int mszinode; /* max size of inode table */
unsigned int mszfile; /* max size of file table */
unsigned int mszproc; /* max size of proc table */
unsigned int mszlckf; /* max size of file record hdr. table*/
unsigned int mszlckr; /* max size of file record lock table*/
unsigned long inodeovf; /* cumul. overflows of inode table */
unsigned long fileovf; /* cumul. overflows of file table */
unsigned long procovf; /* cumul. overflows of proc table */
timet ts; /* time stamp, seconds */
int apstate; /* number of processors */
unsigned long devio[NDEVS][4];/*dev info for up to NDEVS units*/
#define IOOPS 0 /* cumul. I/O requests */
#define IOBCNT 1 /* cumul. blocks transferred */
#define IOACT 2 /* cumul. drive active time in ticks */
#define IORESP 3 /* cumul. I/O resp time in ticks */
};
Note that not all elements of all structures are used by the DG/UX
implementation of sar.
Licensed material--property of copyright holder(s) 3
sar(1M) DG/UX 5.4.2 sar(1M)
FILES
/usr/adm/sa/sadd Daily data file
/usr/adm/sa/sardd Daily report file
SEE ALSO
cron(1M), sar(1), timex(1).
Licensed material--property of copyright holder(s) 4