My Task Monitor (TASKMON)
First off, if you are running a Turnkey 3 system with BSPPILOT then you probably don't want this. As BSPPILOT already does a much better job of system startup and shutdown you need to stick with that if you are already using it.
If you don't use BSPPILOT this may be of use if you havn't already written your own.
Note: there will be no maintenance/fixes for this, I no longer use it as I have merged the moinitor/start function into My MMPF automation utility instead.
Purpose and operation of program
Runs as a started task to periodically checks to see that started tasks are in the state they are supposed to be in, which may be either up or down (yes, can be prefered down).
- Can be used to startup the system, it will ensure everything supposed to be in the up state is running
- Can be used to shutdown the system, a 'F TASKMON,SHUTDOWN' changes the in memory table to set everything to a desired state of down, and TASKMON will stop 30 seconds after the last stop command has been issued
It supports the following operator commands
- F TASKMON,LIST - lists all the control cards currently being used
- F TASKMON,PAUSE - stop monitoring tasks, you presumably are going to be playing around
- F TASKMON,RESUME - resume monitoring tasks
- F TASKMON,NEWDECK - reload control cards, you presumably have updated the control member
- F TASKMON,KILLALL - system shutdown function, stops all monitored tasks and itself, a WTOR is issued for confirmation, continues normal operation until the WTOR is replied to (can reply U (go) or C(cancel) to the WTOR)
- F TASKMON,KILLFORCE - system shutdown function, stops all monitored tasks and itself, no confirmation WTOR, it just does it (added for me, I got sick of the WTOR)
- P TASKMON - stops the TASKMON process
TASKMON card image rules
Card deck rules
Any line with a * in position 1 is a comment line, the actual data card rules are
- columns 1 to 8, the STC jobname to monitor
- column 10, the desired task state, U or D (up or down)
- column 12, what to do if the task is nor running, C or M (issue a Command or Message)
- column 14, determines if it is to be processed by a killall request (K is yes, anything else no)
- columns 20 to 49, the job start command or NOP
- columns 50 to 69, the job stop command or NOP
- columns 70 to 80, reserved at this time
Card deck example
*---+----1----+----2----+----3----+----4----+----5----+----6----+----7 JES2 U C S JES2,PARM='WARM,NOREQ' $PJES2 MMPF U C S MMPF P MMPF TSO U C K S TSO P TSO NET U C K S NET Z NET,QUICK MF1 U C K S MF1 P MF1 FRED U M NOP NOP
JCL to run this job
This JCL should be placed into one of you system procedure libraries so you can 'S TASKMON' it.
//TASKMON PROC MEMBER=TASKMON //TASKMON EXEC PGM=TASKMON //STEPLIB DD DSN=SYS9.LINKLIB.APFAUTH,DISP=SHR <== change dsn //STCLIST DD DSN=SYS9.CONTROL(&MEMBER),DISP=SHR <== change dsn
Current Limitations
As coded it allows a maximum of 20 started tasks to be monitored (I only have 5 so havn't increased it), there are a few constants coded to be changed if you want to increase that. Theoretically (if my multiplication is correct) now I have moved the card rules into a separate DSECT you can use up to 58 rules with no more effort than changing the constants; any more than that and you will need to manage another DSECT. The comments at the top of the code explain what to change if you need more.
Read this far, you probably want it then
The job to assemble TASKMON is available here. Remember to change the dataset name for the library it is to be assembled into.
Change History
- sometime in 2005 - created a program to run as an STC so I could play with the ECB; timers, WTORs, operator commands etc. to the STC. And as I wanted it to do something I let it watch my STCs
- 2005/11/08 - still playing, enhanching, ran out of symbol table space. The only major change here was to create a WTO2 macro to manage all the WTOs as a lot of symbols were being used for nothing but inserting the stcname of the STC running the program into WTOs, the WTO2 macro replaced all that with direct offsets
- 2009/08/25 - needed to change (expand) the card image rule used so I could pass the PARM=... to the JES2 restart (yes I am playing with hot starting jes2). That blew the code space entirely, so moved the rule card storage to a seperate getmained DSECT. As well as freeing up a lot of space in the 4K code block for future enhancements theoretically now 58 rules can be stored in a 4K DSECT; the current 20 rule limit was a constraint of trying to squeeze them into the code space area
- 2017/02/11 - added an extra WTO after the wto reporting a bad data card was discarded to wto the first 40 bytes of the bad data card so it can easily be indentified