What is mon386? was: (Re: Need mon386)
BURNS,JIM
gt0178a at prism.gatech.EDU
Wed Aug 29 09:33:30 AEST 1990
in article <50 at gdx.UUCP>, jay at gdx.UUCP (Jay A. Snyder) says:
> In-reply-to: jct at jct.UUCP's message of 24 Aug 90 02:14:57 GMT
>
> what exactly is this mon386 program?
>
> What does it do?
> --
This is the README file for monitor. Isn't that news.
Written and copyrighted by John C. Tompkins 1989. You may use this for
noncommercial use only. I don't have an army of lawyers but you won't sleep
well if you do try and steal it! :-)
John C. Tompkins
4616 NW 59th St.
Oklahoma City, Oklahoma 73122
(405) 728-1208
This monitor program reads various kernal data structures concerning
system capacity and performance and displays them in a very easy to
understand and "move about" display.
This supplied version will run on XENIX 286 and Convergent CTIX. If you are
a normal user and don't know quite a bit about programming and don't have
XENIX or CTIX, I'm afraid you won't be able to get this program to compile.
You'll have to wait for someone who has a system like yours to do it for you.
Sorry, it can't be helped. Since its reads kernal data, it is VERY dependent
on how your UNIX is implemented. The System V's I've seen are similar but
still vary. XENIX 286 is similar to System V but again different. XENIX 386,
prior to UNIX compatibility, I understand has many Berkley kernal data
structures. And of course Berkley is different. There is no way for me to
implement all the different versions. I have done XENIX 286 and Convergent
Technologies CTIX (at least on a MiniFrame), this should give porters a good
start for places to look. Search for the symbol "#ifdef CTIX", "#ifdef XENIX",
and "#ifdef SYSV".
To get an idea of porting difficulity, look in the system include directory,
<sys/*.h>. On 286 XENIX, include files used, among others, are sysinfo.h,
proc.h, user.h, inode.h and file.h. Data structures used are, among others,
sysinfo, proc, user, inode and file. These include files define what data is
available to monitor and how it is organized, this is what changes for
different UNIX versions. Many versions, such as Convergent CTIX, include data
on disk IO queues and response times. Berkley based versions have similar data
but it is organized very much differently. I understand 386 Unix has a lot
more interesting data than whats available on 286 XENIX. Anyhow, the porting
process involves understanding these data structures, whats available in them,
and what would be interesting to put on the screen. Its really not too
difficult, just a matter of many small details. Some things, such as on top
CPU monitor the percentages for each process, may be a little tricky and
not immediately obvious how it works. Actually the most difficulity I had
in porting to CTIX and XENIX was figuring out where on the swap device
the kernal stored the "user" structure. I had to experiment till I found
what worked and it isn't the same on CTIX as XENIX! This is true on several
data items, they are not part of the normal system documentation. You
just have to keep poking your nose where it doesn't belong and eventually
you will accomplish something.
The library routines sould be fairly easy to port. One problem could be the
system is based on 'termcap' entries and not the newer System V 'terminfo'.
Someone needs to port that, no big deal. It also uses System V style 'ioctl'
calls for terminal line mode control, not Berkley 'stty/gtty'.
If you do a port to another system, PLEASE send me your results or diffs
so I can keep up to date. Also, I would strongly suggest posting your port
or diffs so others can use it.
Some things I've thought about monitoring, but so far haven't gotten
around to are inter-process communication (message queues, shared memory and
semaphores) [as in ipcs], logins/logouts [as in who], free disk space [as in
df], print spooler queues [as in lpstat], serial line status [as in stty] etc.
One reason I haven't done these is on the 286 medium model I'm limited to
64k data+stack and I've used up 99.99% of that. I don't want to go to a large
model because all the far data references will slow down the program too
much. I wanted to keep the CPU usage down to a reasonable level. If someone
expands the capabilities I would appreciate a "#ifdef XENIX286" mode so
I can still use it! Actually, I'm so pressed for memory I've made some
of the popup help windows smaller and decreased the stack size, it still
runs out on some help windows but the main program still runs.
I have included some sample screens (captured directly to a disk file)
showing some of the capabilities. This is by no means a through example, it
doesn't show any help windows, dynamic scaling of graphs, menu usage,
modification of sample intervals. If you study sysinfo.h, proc.h, user.h,
file.h, text.h, inode.h, vars.h you should be able to figure out where the
data comes from for each display. (And of course if its as user friendly as I
hope, I don't even have to explain what you are looking at!) If you can figure
it out, porting should be no problem. (Hey, I figured it out and nobody told
me how!) I have run into real problems, I'm drop me a line, I'll see what I
can do. Note that the '*' characters indicate reverse video spaces and line
drawing sets are used instead of '-' and '|' (you just can't "capture" these
since they are not true ASCII characters. I do have a "Uniplex" capture mode
where you can get everything except color).
Sample screens :
*System*Monitor*Menu* 18:37 Fri, Jun 2, 1989
A : CPU Monitor
B : Disk Monitor
C : I/O Monitor
D : Capacity Monitor
E : Miscellaneous Monitor
F : User Process Monitor
G : Top CPU Process Monitor
*(Q)uit*or*selection*
*CPU*Monitor* 18:38 Fri, Jun 2, 1989
+-( 59)---------------------------+ +-( 8)---------------------------+
| ******************* | | ** |
| +-----+-----+-----+-----+-----+ | | +-----+-----+-----+-----+-----+ |
| 0 20 40 60 80 100| | 0 20 40 60 80 100|
+----------- % CPU Idle ----------+ +----------- % Wait I/O ----------+
+-( 19)---------------------------+ +-( 47)---------------------------+
| ******* | | *************** |
| +-----+-----+-----+-----+-----+ | | +-----+-----+-----+-----+-----+ |
| 0 20 40 60 80 100| | 0 20 40 60 80 100|
+----------- % CPU User ----------+ +---------- % Wait Swap ----------+
+-( 21)---------------------------+ +-( 0)---------------------------+
| ****** | | |
| +-----+-----+-----+-----+-----+ | | +-----+-----+-----+-----+-----+ |
| 0 20 40 60 80 100| | 0 20 40 60 80 100|
+---------- % CPU System ---------+ +------ % Wait Physical I/O ------+
*(Q)uit,*(T)op,*(W)hen*or*<SPACE>*to*backup*
*Disk*Monitor* 18:38 Fri, Jun 2, 1989
+-( 49)--------------------+ +-( 4)--------------------+
| **************** | | ************* |
| +-----+-----+-----+-----+-----+ | | +-----+-----+-----+-----+-----+ |
| 0 20 40 60 80 100| | 0 2 4 6 8 10|
+--------- Reads / Second --------+ +-------- Writes / Second --------+
+-(100)---------------------------+ +-( 25)---------------------------+
| ******************************* | | ******* |
| +-----+-----+-----+-----+-----+ | | +-----+-----+-----+-----+-----+ |
| 0 20 40 60 80 100| | 0 20 40 60 80 100|
+---------- % Read Cache ---------+ +--------- % Write Cache ---------+
+-( 0)--------------------+ +-( 0)--------------------+
| | | |
| +-----+-----+-----+-----+-----+ | | +-----+-----+-----+-----+-----+ |
| 0 2 4 6 8 10| | 0 2 4 6 8 10|
+------- Swap Ins / Second -------+ +------- Swap Outs / Second ------+
*(Q)uit,*(T)op,*(W)hen*or*<SPACE>*to*backup*
*I/O*Monitor* 18:38 Fri, Jun 2, 1989
+-( 30202)--------------------+ +-( 172)--------------------+
| ********** | | ****** |
| +-----+-----+-----+-----+-----+ | | +-----+-----+-----+-----+-----+ |
| 0 20K 40K 60K 80K 100K| | 0 200 400 600 800 1K|
+---- Read Characters / Second ---+ +--- Write Characters / Second ---+
+-( 0)--------------------+ +-( 0)--------------------+
| | | |
| +-----+-----+-----+-----+-----+ | | +-----+-----+-----+-----+-----+ |
| 0 2 4 6 8 10| | 0 2 4 6 8 10|
+---- Read Interrupts / Second ---+ +--- Write Interrupts / Second ---+
+-( 1)--------------------+ +-( 174)--------------------+
| **** | | ****** |
| +-----+-----+-----+-----+-----+ | | +-----+-----+-----+-----+-----+ |
| 0 2 4 6 8 10| | 0 200 400 600 800 1K|
+---- Read TTY Chars / Second ----+ +---- Write TTY Chars / Second ---+
*(Q)uit,*(T)op,*(W)hen*or*<SPACE>*to*backup*
*Capacity*Monitor* 18:38 Fri, Jun 2, 1989
+-( 345600)--------------------+ Wait count : 0
| *********** | Free mem size : 107520
| +-----+-----+-----+-----+-----+ | 84480
| 0 200K 400K 600K 800K 1M| 74240
+------ Free Memory in Bytes -----+ 39424
22528
+-( 11)-------( 60)-+ +-( 11)-------( 40)-+
| **** | | **** |
| +-----+-----+-----+-----+-----+ | | +-----+-----+-----+-----+-----+ |
| 0 20 40 60 80 100| | 0 20 40 60 80 100|
+--------- Process Count ---------+ +---- Open Text Segment Count ----+
+-( 20)-------( 100)-+ +-( 33)-------( 100)-+
| ******* | | *********** |
| +-----+-----+-----+-----+-----+ | | +-----+-----+-----+-----+-----+ |
| 0 20 40 60 80 100| | 0 20 40 60 80 100|
+-------- Open File Count --------+ +-------- Open Inode Count -------+
*(Q)uit,*(T)op,*(W)hen*or*<SPACE>*to*backup*
*Miscellaneous*Monitor* 18:39 Fri, Jun 2, 1989
+-( 17)--------------------+
| ****** |
| +-----+-----+-----+-----+-----+ |
| 0 20 40 60 80 100|
+----- System Calls / Second -----+
+-( 1)--------------------+ +-( 0)--------------------+
| **** | | |
| +-----+-----+-----+-----+-----+ | | +-----+-----+-----+-----+-----+ |
| 0 2 4 6 8 10| | 0 2 4 6 8 10|
+--- Process Switches / Second ---+ +--------- Igets / Second --------+
+-( 0)--------------------+ +-( 0)--------------------+
| | | |
| +-----+-----+-----+-----+-----+ | | +-----+-----+-----+-----+-----+ |
| 0 2 4 6 8 10| | 0 2 4 6 8 10|
+-------- Nameis / Second --------+ +-------- Dirblks / Second -------+
*(Q)uit,*(T)op,*(W)hen*or*<SPACE>*to*backup*
*Top*CPU*Monitor* 18:39 Fri, Jun 2, 1989
+------------------------------------------------+
A : idle | ************************************ |
| |
B : sh 1639 | ***** |
| |
C : sh 1638 | ** |
| |
D : monitor 1620 | |
| |
| |
| |
| |
| |
| |
| |
| |
| +--------+--------+--------+--------+--------+ |
| 0 20 40 60 80 100|
+--------------- % CPU Utilization --------------+
*(Q)uit,*(T)op,*(W)hen,*<SPACE>*to*backup*or*selection*
User - jct *User*Process*Monitor*Menu* 18:39 Fri, Jun 2, 1989
A : 38 - - sh
B : 39 - - sh
C : 1620 - 8% - monitor
D : 1639 - - uucico
E : 1638 - - sh
F : 1640 - - dialHA24
*(Q)uit,*(T)op,*(U)ser,*(W)hen,*(Z)ap,*<SPACE>*to*backup*or*selection*
39 - sh *Process*Monitor* 18:40 Fri, Jun 2, 1989
+-( 0)---------------------------+ Start Time : 18:19:41
| | Start Date : Fri, May 26, 1989
| +-----+-----+-----+-----+-----+ | User ID : jct, jct
| 0 20 40 60 80 100| Group ID : psm, psm
+----------- % CPU User ----------+ TTY : tty02
Parent PID : 1
Process Group : 39
+-( 0)---------------------------+ Process Status : Sleeping
| | Process Flags : Loaded Valid
| +-----+-----+-----+-----+-----+ | Priority : 28, 20
| 0 20 40 60 80 100| Run Time : 606038
+---------- % CPU System ---------+ Total CPU Time : 7 - 0%
CPU User Time : 2 - 0%
CPU Sys Time : 4 - 0%
+-( 0)--------------------+ Open Files : 3
| | Block Reads : 88
| +-----+-----+-----+-----+-----+ | Block Writes : 89
| 0 2 4 6 8 10| I/O Count : 28384
+------- I/O Chars / Second ------+ Curr Dir I-node : 1518
Root Dir I-node : 0
*(Q)uit,*(T)op,*(S)witch,*(W)hen,*(Z)ap*or*<SPACE>*to*backup*
39 - sh *Process*Monitor* 18:40 Fri, Jun 2, 1989
Umask Value : -------w- Open File Status
Ulimit Value : 2097152 Fid Typ Mode Cnt Offset I-node
Text Size : 34816/2 0 C RW 3 239175 117
Data Size : 14336 1 C RW 3 239175 117
Stack Size : 25088 2 C RW 3 239175 117
Pending Signals : None
Time to Alarm : 0
Signal Hangup Trapped
Signal Interrupt Trapped
Signal Quit Ignored
Signal Illegal instruct Trapped
Signal Trace trap Trapped
Signal IOT Trapped
Signal EMT Trapped
Signal FP error Trapped
*(Q)uit,*(T)op,*(S)witch,*(W)hen,*(Z)ap*or*<SPACE>*to*backup*
--
BURNS,JIM
Georgia Institute of Technology, Box 30178, Atlanta Georgia, 30332
uucp: ...!{decvax,hplabs,ncar,purdue,rutgers}!gatech!prism!gt0178a
Internet: gt0178a at prism.gatech.edu
More information about the Comp.unix.xenix
mailing list