DSPMON - Managing Despoolers
DSPMON manages a selected list of despoolers, by starting up despoolers which have print jobs waiting in their formqueues and stopping active despoolers as they become idle, so as to limit the number of simultaneously active despoolers to a pre-defined number.
Syntax
DSPMON {(S}
Options
S Displays Setup menu.
DSPMON
entered at TCL starts the Despooler Monitor in the foreground. The terminal at which DSPMON is executed is then tied up running DSPMON and status messages are displayed on the screen. To stop the DSPMON foreground process, press ctrl+break, or request a wrapup by executing DSPMON (S
from another terminal.
DSPMON (S
entered at TCL displays the Setup menu. This is used to start the Despooler Monitor in the background. The terminal is therefore free to execute other processes at TCL and status messages are written to individual items in the file DSPMON.CONTROL.LOG.
Setup Menu
D E S P O O L E R M O N I T O R S E T U P (V2.1) 1. Busy monitor period, seconds 5 2. Quiet monitor period, seconds 60 3. Number of concurrent DSPMONs 1 4. Maximum number of active despoolers per monitor 10 5. Start multiple despoolers on formqueues N 6. Maximum attempts to start despooler, 0:try forever 0 7. User ID to be notified of disabled despoolers a. Apply changes d. Display despooler status s. Start monitors (changes saved) m. Display monitor status w. Wrapup monitors, stopping despoolers l. Display error log h. Halt monitors, despoolers left running z. Zap (clear) error log r. Re-enable all disabled despoolers x. Exit, changes not saved e. Edit despooler list add/remove/enable Select field or option: MONITORS:0, despooler(s) 0:disabled 0:active 1:inactive 0:jobs 0:errors Last error logged :-
Menu Fields and Options
Menu fields 1 to 7 are selected in order to set up parameters to change the operation of the Despooler Monitor (DSPMON).
Menu option a
or s
must be selected to apply any changes made in fields 1 to 7 before DSPMON will operate using the new setup data. The changes are applied by writing them to a control item CFG in the DSPMON.CONTROL dictionary file. DSPMON then picks up the changes during its next scan cycle.
Field/Option | Description | |
---|---|---|
1.
|
Busy monitor period, seconds
|
The number of seconds the Monitor will sleep between scans when it has active despoolers. |
2.
|
|
The number of seconds the Monitor will sleep between scans when it has no active despoolers. |
3.
|
|
The number of Monitors that will run concurrently, with all monitoring the same set of despoolers. A larger number allows despoolers to be started more quickly on busy systems where many despoolers are being started and stopped. |
4.
|
|
The maximum number of active despoolers that can be associated with a Monitor. |
5.
|
Start multiple despoolers on formqueues
|
If set to Y , allows more than one despooler to be started on form queues with more than one associated despooler. Otherwise only one despooler can be started. |
6.
|
Maximum attempts to start despooler, 0:try forever
|
The maximum number of attempts a Monitor will make when starting a despooler. When this is reached, the Monitor considers the despooler to be disabled. If set to 0, the Monitor does not stop trying. |
7.
|
User ID to be notified of disabled despoolers
|
The |
a.
|
Apply changes
|
Applies the parameters set up using options 1 to 7. |
s.
|
Start monitors (changes saved)
|
Applies the parameters set up using options 1 to 7 and then starts the configured number of Despooler Monitors. If there are no monitors already running, the error log is cleared. |
w.
|
Wrapup monitors, stopping despoolers
|
Stops any despoolers which are idle with no waiting print jobs and does not start any more despoolers. When there are no active despoolers associated with monitors, DSPMON exits. |
h.
|
Halt monitors, despoolers left running
|
Halts the despooler monitor at the end of its next scan cycle. Any despoolers started by DSPMON remain active. If DSPMON is then started again, it detects that these despoolers are active. |
r.
|
Re-enable all disabled despoolers
|
Re-enable all despoolers that have been disabled. |
e.
|
Edit despooler list add/remove/enable
|
Allows you to edit the list of monitored despoolers so that you can add new ones, remove those that are no longer required, disable despoolers (by inserting an asterisk before the despooler name), or enable those that have been disabled. |
|
|
Display the SP-STATUS screen. Enter 99 to return to the Despooler Monitor Setup screen. |
|
|
Displays the monitor status: lists the active Monitors and their ports, a count of the active despoolers associated with each Monitor, an accumulative count of the despoolers that have been started, the number of errors, the CPU time used and the current state. The last line shows totals for all monitors. Press CTRL+E to return to the Despooler Monitor Setup screen. |
|
|
Displays the errors logged by all Monitors. |
|
|
Clears the monitor error log. |
x.
|
Exit, without applying any configuration changes
|
Halt the Despooler Monitor without applying any new configuration changes set up using options 1 to 7. |
Description of Operation
The Despooler Monitor (DSPMON) manages Reality despoolers so as to limit the number of concurrently active despoolers to a pre-defined number (configured using the Setup menu), while enabling the Spooler to service any number of printers. It stops despoolers when they have no more print jobs to despool and starts them again when they are required to despool another print job.
DSPMON.CONTROL File
DSPMON uses a file called DSPMON.CONTROL for control and logging purposes. The DSPMON.CONTROL dictionary contains the following items:
CFG which contains the control parameters set up in options 1 to 7 of the Setup menu.
LOG D-pointer for the log file. Records are logged to DSPMON.CONTROL,LOG when significant events occur. Each record is a plain text item logged per event. Item-ids are 5-digit numbers, starting at 00001 and incremented by one after each event is logged. This enables the SORT and SSELECT commands to be used to view and select items in order of occurrence.
The DSPMON.CONTROL data section contains the following items:
DSPLIST which contains the list of selected despoolers to be monitored by DSPMON, one despooler name per attribute. This list is edited using option e.
on the Setup menu.
Despooler item locks, items of the same name as the despooler, will be item-locked by a DSPMON monitor when it has control of that despooler. Normally these items are not visible.
Monitoring Despoolers
DSPMON monitors the despoolers specified in the DSPLIST item. When DSPMON is first started, it scans the set of despoolers defined in DSPLIST to determine how many are already active, then at predefined intervals (configured in Setup menu option 1), it scans the status of the despoolers in the list and monitors their form queues for waiting print jobs. It then stops any despoolers which are idle with no print jobs waiting and starts any despoolers with print jobs waiting.
If the maximum despooler limit has been reached, then stopping an idle despooler enables another despooler to be started. Once a despooler is started, it despools all print jobs in its assigned formqueues, until it is left idle, when it is stopped by DSPMON again.
If DSPMON is unable to start a despooler, DSPMON logs the fact in DSPMON.CONTROL,LOG, then when DSPMON commences its next scan cycle, it starts at the logged despooler name in the list.
If successive attempts to start a despooler fail, so that the maximum number of attempts, specified by option 4, is reached, that despooler is no longer monitored. DSPMON must be stopped and restarted again, or restarted using option 4, to place the despooler back in the list of despoolers to be monitored.
To cater for despoolers which crash unexpectedly, leaving the despooler in an apparently active state, DSPMON checks each despooler during each scan to ensure that the process is still active.
Multiple Monitors
If required, you can run multiple Monitors - this allows despoolers to be started more quickly on busy systems where many despoolers are being started and stopped. Each Monitor runs independently, scanning the active despoolers in the monitored despooler list which are not already associated with Monitors. If it finds one that needs to be started, it starts it and the despooler then becomes associated with that Monitor. The association ends when the despooler has been stopped again.
Stopping a Despooler
DSPMON stops a despooler in three phases:
- When it detects that a despooler is idle, it sends an SP-STOP command to the despooler to stop it printing anymore print jobs after the current one.
- During the next scan period, on detecting that the despooler has stopped printing, it sends a STOP-DESPOOLER command to stop the despooler process.
- During the next scan period, it normally detects that the despooler is inactive and that the user licence is available for another despooler.