iptracker

iptracker

This is the event checker. It is started usually by iptimer or crontab/sched
tasks.

It reads a parameter file which is used to describe the file name to look for
and the process to run (if required), what logging is needed and how long to
look.

The parameter file is in tables/setup/TRACKER and has the syntax :

    ; comment
    file:   (name)  nolog:  found:(scriptname)
    nofile: (name)  notfound:(scriptname) found:(scriptname) stop:
    wait:   (seconds)
    totalwait:(seconds)
    filechk:(seconds)
    display:(seconds)
    errmsg: (error message)
    okmsg:  (ok message)
    waitmsg:(still waiting message)
    log:    (log this message)
    maxtime:(secs)

where
    file:   Path and name of file to check. If this starts with a '/' it is 
        considered to be the full pathname else it is under fip/spool.
        Trailing wild cards, '*', are permitted. eg file:corrit/G1SI*
    nofile: Path and name of file to check : true if file is NOT FOUND.
    The following options are for both file and nofile :
        If the filename for file/nofile is '$f' then the filename
        will be that passed on input for the -f switch.
        There are also 10 other variable parameters you can pass under
        -0 to -9 switch. These are defined as $0 in the path/filename.
        nolog:  do NOT log if found/not found is TRUE
            default is to log if running script
        found: optional process to run if found. This is usually a
            script in /fip/local. The filename is passed as
            the 1st parameter.  There is an example script in
            local called egformchk.
        notfound: as per found for non-existence.
        stop:   optional - stop processing if this is NOT TRUE.
            Do not continue down the list.
            Normally  if there is a wait it will wait
        nostop: optional - do NOT stop processing if NOT TRUE

    totwait: Total time to wait before we timeout in seconds.
            default is NONE or if parameter is NO - run once only.
            if parameter is 0 - wait indefinitely
    msgafter: optional interval before the first waiting messages. 
        Note this will be after the first check after the msgafter
        time.                   default: 300 secs
    wait: optional interval between waiting messages default: 60 secs
    filechk: optional interval between checking for the file if waiting.
            default: 5 secs.    min: 1 sec. max: 60 secs
    errmsg: error message string            default: std error msg
    okmsg:  message string if ok            default: std ok msg
    waitmsg: message string if we are waiting   default: std wait msg
    error:  1st param - output waiting message every x secs
        2nd param - only start printing waiting message after x secs
        eg error:60:300     print wait msg every minute after 5 mins
            defaults: 1st param=60  2nd param= 60
    maxtime: to wait for a single process before we message a blowout
        Note : this does need to be set for very long processes
                        defaults: 60 secs/1 min

There can be several files in the parameter file which are checked in sequence.
There can be multiple wait/chk/errmess/okmess parameters which take effect for
the next file/nofile.

Plus the usual FipSeq parameters - fixed, partial. combie, option, repeat,
style, replace, newdate, unique, valid, lookup, perl, merge, sum

Input parameters are :
    -1 : Path and name for the $f string which may be used for either
        'file' or 'nofile' to check. If this starts with a '/' it is 
        considered to be the full pathname else it is under fip/spool.
        Note that the wildcard chr, '*' can be specified but, depending
        on the shell used, may need to be quoted.  default: none
    -h : FipHdr fields to fill in extra information! default: none
    -n : run the program at reduced priority    default: nice 5
    -c : do NOT run process - just check        default: run if specified
    -z : parameter file to run          default: none
    -v : display version number and exit.

Version Control
;000a   16jun06 chris original version from ipformch

(copyright) 2017 and previous years FingerPost Ltd.