Problem
How can I use top to monitor activity on my SCO Unix Server?
Solution
top is a commandline tool which gives you a frequently-updated list of processes.
The top command is a very useful and powerful as it shows you which users and processes are consuming the most system resources at any given time.
You can download top from here:OpenServer 6
============
ftp://ftp2.sco.com/pub/skunkware/osr6/vols/top-3.7Sa-VOLS.cpioOpenServer 6 with min Maintenance Pack 3 requiredUnixware 7
==========
ftp://ftp2.sco.com/pub/skunkware/uw7/Packages/top-3.5beta9.pkgOpenServer 5
============
ftp://ftp2.sco.com/pub/skunkware/osr5/vols/top-3.5beta5-VOLS.tarSome useful options:# top -q -s 1 -o cpu 4q = renice to -20. Runs faster s = update screen every second 4 = shows only 4 top processes o = Sort the process display area on the specified field
# top -s 1 -U joe 4
U = only processes for user joeIf you are a system administrator and you are monitoring systems on a regular base it's sometimes very helpful to get see when an issue shows up. top offers the environment variable TOPCOLORS which specifies colors to use and conditions for which they should be used.
The environment variable is a sequence of color specifications,
separated by colons.Each specification takes the form tag=min,max#code- tag is the name of the value to check - min and max specify a range for the value - code is an ANSI color code
You can see a list of color codes recognized by this installation of top with the -T option.
Available color tags
====================
1min 5min 15min header cpu.idle cpu.user cpu.kernel
cpu.wait memory.phys memory.used memory.free
memory.swapused memory.swapfreeHere some examples
==================
TOPCOLORS=cpu.idle=0,10#31
CPU idle between 0 and 10% should be displayed in redTOPCOLORS=cpu.idle=,10#31:memory.used=211968,#31 CPU idle between 0 and 10% should be displayed in red If memory in use >= 207M display in red. Calculate as 1024*207
Some useful special characters while running top. N - sort by process id P - sort by CPU usage h - help page