A Full-Screen, character-based monitor
This program uses the API and the curses programming interface to create a screen full of statistics.
Another sample program written to the data-consumer
API is the
chmon
program . Source code to the program
is in /usr/samples/perfmgr/chmon.c.file. The chmon
program
is also stored as an executable during the installation of the Manager
component. An example program follows:Data-Consumer API Remote Monitor for host Tue Apr 14 09:09:05
1992
CHMON Sample Program *** birte *** Interval: 5 seconds
% CPU EVENTS/QUEUES FILE/TTY
Kernel 13.3 |#### | Pswitch 1295 Readch 24589
User 23.7 |####### | Syscall 6173 Writech 1646
Wait 6.5 |## | Reads 487 Rawin 0
Idle 56.1 |################ | Writes 143 Ttyout 106
Forks 1 Igets 1763
PAGING counts PAGING SPACE REAL MEM 48MB Execs 1 Namei 809
Faults 131 % Used 33.7 % Comp 68.0 Runqueue 1 Dirblk 174
Steals 0 % Free 66.2 % NonComp 15.0 Swapqueue 0 Reads 48
Reclaim 0 Size,MB 96 % Client 4.0 Writes 143
PAGING page/s DISK Read Write % NETWORK Read Write
Pgspin 0 ACTIVITY KB/sec KB/sec Busy ACTIVITY KB/sec KB/sec
Pgspout 0 hdisk0 0.0 35.1 15.7 lo0 1.1 1.1
Pagein 0 hdisk1 0.0 0.0 0.0 tr0 1.1 0.0
Pageout 11 hdisk2 0.0 9.5 3.5
Sios 10 cd1 0.0 0.0 0.0
Process wait (514) %cpu 63.2, PgSp: 0.0mb, uid:
Process xlcentry (12657) %cpu 58.0, PgSp: 1.1mb, uid: birte
Process make (21868) %cpu 15.0, PgSp: 0.2mb, uid: birte
Process make (5998) %cpu 15.0, PgSp: 0.1mb, uid: birte
The
chmon
command
line is:chmon[-iseconds_interval][-pno_of_processes][hostname>]
Item | Descriptor |
---|---|
seconds_interval | Is the interval between observations. Must be specified in seconds. No blanks must be entered between the flag and the interval. Defaults to 5 seconds. |
no_of_processes | Is the number of “hot” processes to be shown. A process is considered “hotter” the more CPU it uses. No blanks must be entered between the flag and the count field. Defaults to 0 (no) processes. |
hostname | Is the host name of the host to be monitored. Default is the local host. The sample program exits after 2,000 observations have been taken, or when you type the letter “q” in its window. |