| iMatix home page
| << | < | > | >>
SMT Logo SMT
Version 2.81

The Unattended Process Monitor (UPM) Tool

Overview

The UPM tool is a small application developed with SMT, and included as an example. The UPM tool was developed on UNIX and may not be very useful on other systems.

The UPM tool allows you to manage 'unattended' processes, which may handle input/output on some devices, typically terminals. The UPM tool lets you start and stop such processes, manually or using a timer.

Technical Details

The UPM tool consists of four programs:

  1. upmd is a server program that runs permanently.
  2. upmc is a client program that provides a command-level interface.
  3. smtupmd is an agent that handles the UPM server protocol. The upmd program is basically a wrapper around this agent.
  4. smtupmc is an agent that handles the UPM client protocol. The upmc program is basically a wrapper around this agent.

The main UPM configuration file is called "upm.ini". This is a typical "upm.ini" file: [Setup] logfile=upmd.log [Tasks] name=task1 name=task2

The [Tasks] section defines each of the UPM tasks. Each task has a config file to define task-specific values. The config file for "task1" is called "TASK1.ini". For example:

#   Configuration for Task 1
[Setup]
    stdin=/dev/pts/1
    stdout=/dev/pts/1
    stderr=/dev/pts/1
[Environment]
    DATABASE=test
    PRINTER=tcp://localhost:1000
[Run]
    idle=banner IDLE
    startup=run BBORNE.gnt
    cancel=cleanup

The [Setup] section defines the input/output devices for the task. The [Environment] section defines a list of variables for the task. The [Run] section defines the idle command and the startup command. These commands must be executable files (scripts or programs) with optional arguments. Redirection or multiple commands are not permitted.

Each task also has an optional TIMES file. The times file for task1 is called "TASK1.tim", and looks something like this:

#  This file specifies the times for Task1

mon 8-12 12:30-20
tue 8-12 12:30-20
wed 8-12 12:30-20
thu 8-12 13:05-13:06  13:08:13-10
fri 8-12 12:30-20
12/25 off
1/1 off

Each line (except blank lines and comments) defines some times for a day. The first word on the line is the day, the remaining words are one or more time specifications. A day can be:

A time specification can be:

If no TIMES file is provided, you can (or rather, must) start and stop the tasks manually.

Using The UPM Tool

  1. Define the upm.ini and task .ini files correctly. Make sure that the devices exist and are writable.
  2. For testing, run the upmd program in a shell window. For real life use, place into the system startup procedure (inittab on a UNIX system). You can run upmd in the background like this (assuming a UNIX system):
    nohup upmd&
    

    Run the command upmc to start the BORMAN client. The upmc program acts as a 'front-end' for the upmd daemon. Since the daemon runs as a process in the background, it cannot read commands from the keyboard itself.

    When you run upmc you get a message like this:

    upmc> 100- Connecting to UPM daemon...
    upmc> 102- Connected to UPM daemon version 1.0
    upmc>

    You can give various commands at the prompt. This is what the 'help' command shows:

    upmc> help
    Commands and arguments can be in any case.  Commands are:
    LIST                 - list all known tasks
    START [task | ALL]   - start specified task (default all)
    STOP [task | ALL]    - stop specified task (default all)
    STATUS [task | ALL]  - show status for specified task (default all)
    HALT                 - halt UPM daemon
    EXIT                 - end this UPM client session
    QUIT                 - end this UPM client session
    HELP                 - show this information
    VERSION              - show UPM client version
    

    If you run upmc when the upmd daemon is not running, you get this:

    upmc> 100- Connecting to UPM daemon...
    upmc> 301- UPD daemon connection failed: Connection refused
    

    You can also run upmc to execute a command directly:

    $ upmc start all
    
    Which is the same as typing this:
    $ upmc start
    

    UPM Trouble Shooting

    These are some possible errors:

    • The device you specified in the task .ini file is not accessible to the upm daemon. You will get an error message in the daemon log file, or in the shell window where you ran upmd.
    • The commands you specified in the task .ini file are not found or not accessible. You will get an error message in the daemon log file, or in the shell window where you ran upmd.

    UPM Implementation

    The hypertext view of SMTUPMD's dialog and source code may help to understand how SMTUPMD works.

    The hypertext view of SMTUPMC's dialog and source code may help to understand how SMTUPMC works.


    | << | < | > | >> iMatix Copyright © 1996-99 iMatix Corporation