*************************************************************************

    MONITOR FOR AIX 
    Copyright (C) All rights reserved:
        1993-2001 Marcel J.E. Mol, MESA Consulting B.V., Netherlands
        1991-1995 Jussi Maki, Finland

    NON-COMMERCIAL USE ALLOWED. YOU ARE FREE TO DISTRIBUTE
    THIS PROGRAM AND MODIFY IT AS LONG AS YOU KEEP ORIGINAL
    COPYRIGHTS.

*************************************************************************

What
----
Monitor program is an AIX System performance monitor program.
Monitor can be used to display system statistics of various short time
performance values on a full screen terminal for AIX releases 3.1 up to 4.3.
Some utilities are available to process performance statistics gathered with
the log option. If you developed your own tools to do this we'd be happy
to add that to this distribution!

Where
-----
The latest version of Monitor is available for anonymous ftp/http from

    ftp://ftp.mesa.nl/pub/monitor
    http://www.mesa.nl/pub/monitor

In time it can also be found on

    ftp://nic.funet.fi

User visable changes
--------------------
(see CHANGES file for details):

New to version 2.1.7/2.1.8
        * Better support for AIX 4.3 and especially AXI 4.3.3
        * Compiling NFS stuff fixed
        * Logging of NFS data (but no max values yet)
        * Hopefully fixed memory statistics for all AIX versions
        * Limit number of disks shown (see -D option)
        * Bug fixes

        NOTE: NFS statistics for AIX 4.2 and above are only shown
              for NFS V2. NFS V3 statistics are not support yet.

New to version 2.1.5
        * Support for AIX 4.3
        * Added AFS support to public release
        * Bug fixes

New to version 2.1.3
        * -H option can specify colors var headers, metric names and values
          (AIX 4 only.)
        * Cosmetic fixes.
        * New sort options for top (cpu, memory, paging).
        * Interactive commands to change things while running.
        * AFS support (convince me you have an AFS license...).
        * Semantic changes for several options.
        * Bug fixes.

New to version 2 (released as version 2.1.1)
	* Allow logging of information on interval basis in ascii format.
	  The logfile can be specified as a strftime string and can be
	  compressed.
	* Synchronize sample/interval time on wall clock (from 00:00).
	* Sample/interval time is now accurate to around 10 milliseconds
          (depending on system load).
	* User counts for remote and inactive users, and average inactive time.
	* System uptime is printed.
	* Highlighted headers (-H option)
	* In logmode, filesystem usage is logged
        * support for Symmetric multiprocessing cpuinfo (-smp option
          or 's' character command).
        * help page in interactive mode 'h' or '?' character commands

New to version 1.12 (16-Jun-1994)
	* show more detailed memory usage. (This is estimated
	  since there are no published AIX internals quide). Thanks
	  to Pierre Verpeaux for pointing this out from vmtune.c 
	  samples code.
	* rewrote part of the monitor code in a more layered method
	  (now interfaces to kernel are in libmonitor.a, see monitor.3)
        * fddi interface shown correctly
	* monitor -net to display more on network interface
	* disk information restructured to contain summary and detail
	* monitor -top with wide screen shows now more
	  information on processes
	* loadavgLED works now both on 3.2.4 and 3.2.5

New to version 1.11
        * support for more disk information with -disk flag
	* support for NFS operations display (eg. man nfsstat)

New to version 1.10
  	* fixed support for model 220 on memory displays (it should
          propably work, this has not been tested with many
          configurations). Made monitor to use avenrun values from
	  kernel which are supported after AIX 3.2.4.
	* a separate program is supplied for display loadaverage values in LEDs

Versions 1.07 - 1.09 were for internal testing 

New to version 1.06
	* support for IBM RISC System 6000 model 220. Monitor should now
	  displays amount of total memory correctly.
	* optional support for led display (compile loadavgd program
	  with -DLED option). (LED-display will show 1 minute load average
	  in RS/6000 front LED-display using letter 'c' and it's mirror image
	  as decimal point. Each time that loadavgd is responds to
	  getloadavg() call LED-display is refreshed and decimal point
	  is changed to its mirror image.)

New to version 1.06beta
	* support for AIX 3.2. Note, version compiled in AIX 3.2
	  don't work in AIX 3.1!
	* bug fixes
	* support for immediate screen refresh (with ctrl-L)
	* nroff -version of man-page in file monitor.1
	* for wider screens top will show user and system time distribution

New to version 1.04
	* process info sorted by cpu-usage (in top.c and top.h files)
	  try 'monitor -top'
	  Information shown are process-id, username, priority, nice-value,
	  program size (virtualmemeory), program size in real memory (RES),
	  process status, used cputime, cputime usage between display refresh.
	* new flags [-top [nprocs]] [-all]
	* changed exit with ctrl-c or q

New to version 1.03
	* included uptime-command that users loadavgd to get loadavgvalues

New to version 1.02
	* start using loadavgd-daemon
	* added ethernet-interface number to name
	

How to install:
--------------
	To install the monitor place the source to appropriate
 	directory, then 

                edit Makefile 

        Set the specified options to proper values. Then use the

		make 

	command to compile the sources.	Programs can be installed with

		make install

	By default programs are installed to /usr/local/bin (see PREFIX
        in Makefile) directory.
        Run either as root or make the program owner root and program setuid.
        (make install does that for you)
            chown root.system monitor
            chmod 2711 monitor


METRICS
-------
System events monitored and some features are:
(most of the values are converted to units/second).
  * hostname and date
  * percentage distribution of cpu-load (system, wait, user and 
    idle percentages) with graf where '=' means system,	
    'W' means wait, ">" means user and "." means idle time.
  * SMP - Symmetric multiprocessing cpuinfo for AIX4 machines (-smp option)
  * runnable processes value/second and load average values
    of 1, 5 and 15 minute times 
  * both free and total from real and virtual memory,
    real memory is RAM-memory and virtual memory
    is paging space. Differentiate between process an file mapping.
  * Filesystem usage statistics (in logging mode)
  * Top cpu users 
  * NFS operations
  * More detailed disk I/O screen (with -disk option)
  * More detailed network I/O screen (with -net option)
  * Toggle between normal/top/net/disk display using t,n,d keys
  * processes waiting to be swapped in
  * paging information; pagefaults, pages to be paged in and out
    from user space and pages to be paged in and out from
    paging (swap) space, page size in AIX 3.1 is 4 kB,
  * various process and system events: process (context) switches,
    system call, read and write -calls, forks and execs,
    three interrupts rcvint, xmtint, mdmint.
  * File and tty-IO variables; iget, namei and dirblk, amout of read
    and written kbytes, amount of ttybased characters handled.
  * Disk-information, read and written bytes/second and amount
    of busy time. Possibly sorted. 
  * network (netw) information; amount read and written kB per second.
  * logging metrics to a file


See also:
	AIX commands vmstat(1), sar(1), netstat(1)
	/usr/include/sys/{sysinfo.h, vminfo.h, iostat.h}
	/usr/include/sys/if.h

A few sh/awk script are available to generate plots certain metrics. You
need gnuplot to actually build the graphs. If you have other/better tools
please donate!

Monitor package includes following utilities in source code:
 + monitor    - the monitoring program itself
 + top        - a shell script to call monitor -top
 + uptime     - a Berkeley like uptime for pre AIX 3.2.4 systems
 + fps	      - fast ps command which can follow one process (fps -c -p PID)
 + loadavgd   - for pre AIX 3.2.4 systems to calculate load average values
 + loadavgLED - program to show load average values on 3 digit LED display
 + libmonitor.a - library for getting performance statistics from AIX kernel
 + vmker      - program to dump the vmker kernel structure. This may change
                from AIX version to AIX version...

Some of the monitor displays look approximately like following:
-------------------------------------------------------------------------------
AIX System monitor v2.1.5, 26jun98: mesa.nl       Tue Jun 25 16:43:12 1998
Uptime:  15 days, 06:21   Users:   2 of  14 active 14 remote 83:02 sleep time
CPU: User 14.2% Sys 10.0% Wait 12.8% Idle 63.0%%  Refresh:  5.00 s
0%             25%              50%               75%              100%
>>>>>>>>>>=======---------

Runnable (Swap-in) processes  0.40 (0.20)  load average:  0.15,  0.15,  0.26

Memory    Real     Virtual    Paging (4kB)    Process events     File/TTY-IO
free        3 MB    533 MB       5.8 pgfaults     360 pswitch      94 iget
files      90 MB                 0.0 pgin         436 syscall      84 namei
total     256 MB    768 MB      26.4 pgout         35 read          0 dirblk
IO (kB/s) read  write busy%      0.0 pgsin         23 write      2033 readch
hdisk0     0.0   56.6   12       0.0 pgsout         0 fork       8670 writech
hdisk1     0.0   32.0    1                          0 exec         12 ttyrawch
hdisk2     0.0    0.0    0    Clnt  Serv NFS/s      0 rcvint        0 ttycanch
hdisk3     0.0   16.8    5      81.0    0.0 call    0 xmtint       94 ttyoutch
hdisk4     0.0    0.0    0       0.0    0.0 retr    0 mdmint
hdisk5     0.0    0.0    0       0.0    0.0 getattr
hdisk6     0.0    0.0    0      80.0    0.0 lookup    Netw   read  write kB/s
hdisk7     0.0    0.0    0       0.0    0.0 read       lo0     2.0     2.0
                                 0.0    0.0 write      en0     0.0     0.1
                                 1.0    0.0 other      tr0    15.7    15.4
                                                      css0     0.0     0.0

-------------------------------------------------------------------------------
% monitor -alternative -top
Load averages:  0.98,  0.44,  0.34           mesa.nl   Tue Jun 25 16:48:35 1996
Cpu states:  9.2% user  3.0% system  1.2% wait 86.6% idle
Logged on:  14 users   3 active 14 remote 87:04 sleep time
Real memory:  153.7M procs   88.6M files   13.8M free  256.0M total
Virtual memory:             224.9M used   543.1M free  768.0M total
   PID USER     PRI NICE  SIZE    RES STAT   TIME CPU%      COMMAND
   516 root     127  21    16K    20K  run  12184 87.7/55.4 Kernel (wait)
 91388 root      62   0  3388K  3732K  slp   1:03  4.7/ 4.1 sysmandV4
 17388 root      61   0  3812K  4316K  slp   0:44  4.5/ 2.9 sysinfodV4
 54092 sb00108   60   0   623K   712K Frun   0:00  2.1/ 3.0 monitor
 48928 controlm  60   0  1994K  1020K Fslp 413:18  0.2/ 1.9 dataserver
 73426 root      60   0   982K  1172K  slp   0:08  0.1/ 0.5 snmpd
 18634 cics      60   0  1178K   592K  slp   0:03  0.1/ 0.0 cicsteld
  1032 root      37  21    56K    56K  slp  91:29  0.0/ 0.4 Kernel (gil)
     1 root      60   0   348K   236K  slp  89:35  0.0/ 0.4 init
  2098 root      60   0    76K    44K  slp  29:49  0.0/ 0.1 syncd
     0 root      16  21    20K    24K  slp  28:31  0.0/ 0.1 Kernel (swapper)
 18280 root      41 -19  1036K   252K  slp   9:33  0.0/ 0.0 hbd  
 96770 root      60   0    22M    19M  slp   9:27  0.0/ 1.0 dced
 51716 controlm  60   0   377K   324K Fslp   8:00  0.0/ 0.0 p_ctmsl
 18074 root      48 -12   248K   204K  slp   3:42  0.0/ 0.0 xntpd  
 49670 controlm  60   0   365K   176K Fslp   3:31  0.0/ 0.0 p_ctmco
 50394 controlm  60   0   295K   228K Fslp   2:40  0.0/ 0.0 p_ctmsu
 50942 controlm  60   0   353K   240K Fslp   1:53  0.0/ 0.0 p_ctmsb
  3382 root      60   0   144K   148K  slp   1:29  0.0/ 0.0 syslogd
-------------------------------------------------------------------------------
% monitor -alternative -smp
Load averages:  0.49,  0.43,  0.34           mesa.nl   Tue Jun 25 16:49:42 1996
Cpu states:  3.1% user 10.5% system 11.7% wait 74.7% idle
Logged on:  14 users   3 active 14 remote 88:02 sleep time
Real memory:  163.2M procs   90.2M files    2.6M free  256.0M total
Virtual memory:             232.7M used   535.3M free  768.0M total
CPU USER KERN WAIT IDLE% PSW SYSCALL WRITE  READ WRITEkb  READkb
#0     3   10   12   75  199     819     4    64    0.28  228.87
#1     2   11   12   75   88     138    11    29    1.39    8.49
#2     4    9   12   75   84      37     1     5    0.06  109.28
=====================================================================
SUM    3   10   12   75  271     994    16    98    1.73  346.64
-------------------------------------------------------------------------------
% monitor -alternative -top -smp -disk -net
Load averages:  0.33,  0.37,  0.33           mesa.nl   Tue Jun 25 16:54:46 1996
Cpu states:  6.3% user  5.3% system  0.0% wait 88.3% idle
Logged on:  11 users   3 active 11 remote 106:01 sleep time
Real memory:  158.3M procs   55.4M files   42.3M free  256.0M total
Virtual memory:             223.7M used   544.3M free  768.0M total
CPU USER KERN WAIT IDLE% PSW SYSCALL WRITE  READ WRITEkb  READkb
#0     6    5    0   88  176     440    11    31    0.73   37.63
SUM    6    5    0   88  176     440    11    31    0.73   37.63
DiskIO    read  write     rsize  wsize  xfers seeks blksize xrate busy
hdisk0     0.0    0.0 kB/s  0.0  0.0 kB   0.0   0.0     512    0   0%
hdisk1     0.0    0.0 kB/s  0.0  0.0 kB   0.0   0.0     512    0   0%
hdisk2     0.0    0.0 kB/s  0.0  0.0 kB   0.0   0.0       0    0   0%
Total      0.0    0.0 kB/s  0.0  0.0 kB   0.0   0.0     384    0   0%
Active disks: 0
Netw   read  write kB/s  packin  packout insize outsize
 lo0     0.3     0.3        4.0      4.0     81     81
 en0     0.0     0.4        0.7      1.0     51    418
 tr0     0.2     0.2        3.7      2.7     43     64
css0     0.0     0.0        0.0      0.0      0      0
   PID USER     PRI NICE  SIZE    RES STAT   TIME CPU%      COMMAND
   516 root     127  21    16K    20K  run  12189 88.3/55.4 Kernel (wait)
 17388 root      63   0  3812K  4316K  slp   0:54  6.6/ 2.8 sysinfodV4
 22682 sb00108   61   0   659K   752K Frun   0:00  3.6/ 3.9 monitor
 91388 root      61   0  3392K  3736K  slp   1:17  1.3/ 4.0 sysmandV4
 48928 controlm  60   0  1994K  1020K Fslp 413:21  0.0/ 1.9 dataserver
  1032 root      37  21    56K    56K  slp  91:30  0.0/ 0.4 Kernel (gil)
     1 root      60   0   348K   236K  slp  89:37  0.0/ 0.4 init
  2098 root      60   0    76K    44K  slp  29:50  0.0/ 0.1 syncd
     0 root      16  21    20K    24K  slp  28:32  0.0/ 0.1 Kernel (swapper)


     ======--------         Marcel J.E. Mol                MESA Consulting B.V.
    =======---------        ph. +31-06-54724868            P.O. Box 9
    =======---------        marcel@mesa.nl                 2270 AA  Voorburg
__=======-------------____U_n_i_x______I_n_t_e_r_n_e_t____ The Netherlands ____
 They couldn't think of a number, so they gave me a name!
                                -- Rupert Hine

+------------------------------------------------------------------------+
! Jussi Maki                          ! Email: Jussi.Maki@csc.fi         !
! Centre for Scientific Computing     ! URL:   http://www.csc.fi/~jmaki  !
! P.O. Box 405                        ! Voice:     +358-0-457 2747       !
! FIN-02101 Espoo, Finland            ! Telefax:   +358-0-457 2302       !
+------------------------------------------------------------------------+
