This is psmon. A very simple process monitor.

psmon - simple process monitor


usage: psmon [-u user] [-s 'include pattern'] [-S 'exclude pattern']
             [-t /path/to/table]

The first time psmon is run, it will write the process table to disk.
Subsequent runs will compare the current process table with the cached
copy. Any duplicates found will be printed to stdout.

Options include:

-u user         look for processes owned by this user
-s 'inc pat'    only examine processes that match this pattern (Perl
regex)
-S 'exc pat'    only examine processes that do not match this pattern
(Perl regex)
-t /path/table  alternative path to the process table cache (default
$HOME/.psmontab)

This may be run from cron:

  MAILTO=admin
  */5 * * * * psmon -u joe -s 'mybig\.cgi'

Every 5 minutes, psmon will look for duplicate processes and write
them out:

  Process found: 1442 [joe] perl /cgi-bin/mybig.cgi

Some pattern examples:

  ## look at all processes with 'sh' in them, except 'ssh' and 'bash'
  psmon -u joe -s 'sh' -S '(?:ssh|bash)'

  ## apache (httpd and httpsd)
  psmon -u www -s 'https?d'

Scott Wiersdorf