YAPS - Yet Another PS program


yaps: Yet Another ps command (like we really need another one, eh?!?)


I wrote this because we had problems with processes becoming "runaways"
i.e. going into "spin mode" and just consuming resources. Then users
would Email/call us complaining there machines were running slow.

So all yaps basically does is parse the output from the ps command into
a more useable/easier to read format (with only the stuff that is mostly
of interest IMHO) and allows you to display only those processes that 
meet certain criteria - i.e. resources consumed greater than a certain
value for CPU-TIME, ELAPSED-TIME, and/or MEMORY - here's an example: 
   goose (ALEK) yaps -cpu=5
    USER       PID  ELAPSED-TIME  %CPU      CPU-TIME  MEMORY-K   COMMAND & ARGS
    root       180    3-18:51:54   0.2          9:27      4520   /usr/sbin/syslogd
Shows only those processes with CPU-TIME greater than 5 minutes.

You can also explicitely exclude certain processes and/or users by providing
a file that list those ... see yaps_procs and yaps_users for examples of
what we use here. 

Finally, it has handy flags to syslog stuff it finds, send Email to the owner, 
and/or send a kill signal to the process. We run two cron scripts every night:
   - cron.notify sends syslog messages of anything that looks "odd"
   - cron.kill whacks runaway processes (be careful!)

So while this is useful for interactive use to quickly see processes
that are "interesting", it truly shines IMHO for "batch/background" use
to keep things in line for me!   BTW, YAPS uses the UNIX95 ps command;
and is supported/tested on HPUX10.20, IRIX6.x, and Solaris2.x (or higher).


Installing yaps is trivial ... tweek the path to Perl and the first
couple lines (it outlines what needs to be done) and if you want, tweek 
the yaps_{procs,users} files ... and then rock-n-roll. As implied above, 
you may want to setup cron scripts (examples included) to do notification
and optional killing of stuff that is amiss.


Here is the tarball for version 1.4 (000627)

UNIX Sysadmin Tools and Alek's free personal web pages