.TH hmon "" "" Command
.PC "Monitor the COHERENT System"
.B hmon
.PP
The command
.B hmon
continually displays a summary of your system's activity.
It uses an interactive display with which you can easily send a signal
to a selected process.
.PP
When you invoke
.BR hmon ,
it displays a display that resembles the following:
.B1
.sp \n(pDu
	Last PID=91     Total Mem=15684K        Free Mem=7844K (50.01%)
	Total=20  Running=1   Zombies=0   Locked=0   Waiting=5   Sleeping=14
	PID=91  Idle=75.68%     User= 8.11%     Sys=16.22%
	Load= 1.60      Load Averages:  1:3.38  5:1.01  20:0.27
.sp \n(pDu
	PID   PPID  Username Ksize User  Sys   %User %Sys  Flag tty     S Command
	   91    89 fred       148 00:04 00:01  5.41  1.80 4001 ttyp1   R hmon
	   89    88 fred       129 00:00 00:00  0.00  0.00 6001 ttyp1   W ksh
	   88     1 root       735 00:04 00:19  0.00  1.80 4001 null    S xterm
	   86    80 fred       208 00:00 00:00  0.00  0.00 6001 ttyp0   S me
	   80    78 fred       129 00:00 00:00  0.00  0.00 6001 ttyp0   W ksh
	   79    76 fred       284 00:00 00:07  0.90  9.01 4001 null    S fvwm
	   78    76 root       727 00:00 00:01  0.00  0.00 4001 null    S xterm
	   76    64 fred        79 00:00 00:00  0.00  0.00 6001 null    S sh
	   70    64 root      2423 00:15 00:11  1.80  3.60 6001 console S X
	   64    54 fred       105 00:00 00:00  0.00  0.00 6001 color0  W xinit
	   56     1 root        28 00:00 00:00  0.00  0.00 4001 com2l   S getty
	   55     1 root        28 00:00 00:00  0.00  0.00 4001 com3l   S getty
	   54     1 fred       129 00:00 00:00  0.00  0.00 6001 color0  W ksh
	   53     1 root        28 00:00 00:00  0.00  0.00 4001 color1  S getty
	   52     1 root        28 00:00 00:00  0.00  0.00 4001 color2  S getty
	   51     1 root        28 00:00 00:00  0.00  0.00 4001 color3  S getty
	   47     1 daemon      55 00:00 00:00  0.00  0.00    1 null    S lpsched
	   45     1 root        36 00:00 00:00  0.00  0.00    1 null    S cron
.sp \n(pDu
.B2
.PP
The first four lines
.DM
	Last PID=91     Total Mem=15684K        Free Mem=7844K (50.01%)
	Total=20  Running=1   Zombies=0   Locked=0   Waiting=5   Sleeping=14
	PID=91  Idle=75.68%     User= 8.11%     Sys=16.22%
	Load= 1.60      Load Averages:  1:3.38  5:1.01  20:0.27
.DE
.PP
summarize your system's status.
The lines that follow summarize each process.
Each line contains the following information:
.IP "\fBPID\fR"
The identifier of the process.
.IP \fBPPID\fR
The process identifier its parent process.
Note that process 1,
.BR init ,
has no parent process.
For more details on
.BR init ,
see its entry in the Lexicon
.IP \fBUsername\fR
The login identifier of the user who owns this process.
.IP \fBKsize\fR
The process's size, in kilobytes.
Note that this does
.I not
include memory that the process allocates for itself.
.IP \fBUser\fR
The amount of user time that this process has consumed.
.IP \fBSys\fR
The amount of system time that this process has consumed.
.IP \fB%User\fR
The percent of user time this process has consumed.
.IP \fB%Sys\fR
The percent of system time this process has consumed.
.IP \fBFlag\fR
The process's flag bits OR'd together, as follows:
.DS
.ta 0.8i 1.4i
\fBPFCORE\fR	00001	Process is in core
\fBPFLOCK\fR	00002	Process is locked in core
\fBPFSWIO\fR	00004	Swap I/O in progress
\fBPFSWAP\fR	00010	Process is swapped out
\fBPFWAIT\fR	00020	Process is stopped (not waited)
\fBPFSTOP\fR	00040	Process is stopped (waited on)
\fBPFTRAC\fR	00100	Process is being traced
\fBPFKERN\fR	00200	Kernel process
\fBPFAUXM\fR	00400	Auxiliary segments in memory
\fBPFDISP\fR	01000	Dispatch at earliest convenience
\fBPFNDMP\fR	02000	Command mode forbids dump
\fBPFWAKE\fR	04000	Wakeup requested
.DE
.IP
For example, process 8460 has flag ``4001''.
This means that the process is swapped out and and that a wakeup has
been requested.
This is consistent with the `S' status, which means that it is sleeping.
Note that the flags for swapping do not contain useful information as
\*(CO does not yet support demand paging.
.IP \fBtty\fR
The port from which the process was launched.
This can be the console, a pseudo-tty, or a serial port.
.IP \fBS\fR
The process's status, as follows:
.DS
\fBR\fR	Ready to run (waiting for CPU time)
\fBS\fR	Stopped for other reasons (I/O completion, pause, etc.)
\fBT\fR	Process is being traced by another process
\fBW\fR	Waiting for an existent child
\fBZ\fR	Zombie (dead, but parent not waiting)
.DE
.IP \fBCommand\fR
The name of the program that this process represents.
.PP
One of the process lines will be highlighted.
You can shift the line of highlighting by pressing the keys \*(UA and \*(DA.
When a process line is highlighted, you can send that process
a signal simply by pressing a key, as follows:
.IP \fB1\fR 0.3i
Send signal
.BR HUP .
Equivalent to typing
.BR "kill \-1" .
.IP \fB2\fR
Send signal
.BR INTR .
Equivalent to typing
.BR "kill \-2" .
.IP \fB3\fR
Send signal
.BR QUIT .
Equivalent to typing
.BR "kill \-3" .
.IP \fB9\fR
Send signal
.BR KILL .
Equivalent to typing
.BR "kill \-9" .
.PP
Whether the signal has any effect will, of course, depend upon the degree of
control you have over that process.
.PP
To refresh the
.B hmon
screen, type
.BR L .
To quit,
type
.BR Q .
.SH "See Also"
.Xr "commands," commands
.Xr "ps" ps
.SH Notes
.B hmon
reads the free memory from
.BR /dev/freemem .
If this device does not exist on your system, create it as follows:
.DM
	mknod /dev/freemem c 0 12
	chmog 444 sys sys /dev/freemem
.DE
.PP
.B hmon
uses
.B curses
to manage its display.
Your screen will not appear properly if the environmental variable
.B TERM
is not set correctly for the display device you are using, or if its
.B terminfo
entry is not correct.
.PP
.II "Pulley, Harry C.
.B hmon
was written by Harry C. Pulley, IV (hpulley@uoguelph.ca).

