|
The Session Manager exits provide you with a wide range of monitoring capabilities.
You can monitor all users in the same way, monitor each class of
users differently, or group various classes of users together and
monitor the groups differently. Use the Session Manager exits to: - Monitor all of the users with the same logon procedure in the
same way
- Monitor and intercept certain commands
- Retain a log of a user's session
- Determine how long it takes a command to run or determine at what
time certain operations were performed
The following describes these four possible uses and provides an
example initialization exit. - Monitor all of the users with the same logon procedure in the
same way
You can use multiple exits with logon procedures to provide
different default environments for certain classes of users and to
monitor groups of users in the same way.
For example, suppose
your installation has two logon procedures for Session Manager: - LOG1 - specifies the default environment module ENV1
- LOG2 - specifies the default environment module ENV2
If you had three Session Manager exits (EX1, EX2, and EX3), you could
link-edit them into the ENV1 and ENV2 modules. All Session Manager users would
be monitored by the exits regardless of whether they log on with the
LOG1 or LOG2 procedure.
To monitor users who use the LOG2 procedure
differently, you could write a second stream monitoring exit (NEWEX2).
Link-edit NEWEX2 into the ENV2 default environment module or incorporate
NEWEX2 directly into the ENV2 module and reassemble ENV2. Then, users
who log on with the LOG1 procedure are monitored by the EX1, EX2,
and EX3 exits; users who use the LOG2 procedure are monitored by the
EX1, NEWEX2, and EX3 exits.
- Monitor and intercept certain commands
You can monitor the
various streams to intercept particular commands and perform some
action based on the user and the command. You can monitor and intercept: - TSO/E commands and output
- Program input and output
- Session Manager commands and output
- Messages that users receive
For example, you can monitor TSO/E input and restrict
specific users or groups of users from using certain commands. When
the exit intercepts the command, it can change it to blanks or some
other characters. If you eliminate commands in this way, you must
not change the length of the line.
If you monitor an input stream,
you should be aware that the command may not be ready to execute because
other commands may be stacked ahead of it. At this point, the input
line is being placed into the input stream. If you want the exit
to perform an action on that specific command, detect the command
as it is copied to the output stream. At that point, Session Manager is returning
the command to TSO/E in order for it to execute.
If you want
the exit to intercept a specific command as it is copied to the output
stream, you do not have to monitor every line of output. Monitor only
the input until the exit detects the command. The exit can then start
monitoring the output until the command is copied to the output stream.
The exit can perform the required action and then go back to monitoring
input only.
To dynamically change which streams are being monitored,
use the initialization and stream monitoring exits. The initialization
exit can save the address of the stream mapping in the "installation
data" fullword. The stream monitoring exit can change the stream
mapping that defines which streams are being monitored. For example,
if you are monitoring TSO/E input and detect a particular command,
you can start monitoring the TSO/E output stream. When the next command
is retrieved for TSO/E input, you can then go back to monitoring only
TSO/E input.
- Retain a log of a user's session
To monitor the input,
output, and message streams and write each line to a data set, use
the stream monitoring exit. To create a hard copy of the data set,
use the termination exit.
The stream monitoring exit must not
do any I/O operations. To prevent performance degradation, the initialization
exit can attach another task during initialization to handle I/O requests
from the stream monitoring exit. Whenever the stream monitoring exit
is ready to write a record, it can post the I/O task and pass it a
buffer with the record. The stream monitoring exit can then return
to ADFIMPUT, which lets Session Manager continue while the I/O task is asynchronously
writing the record.
The task that the initialization exit attaches
runs without holding the local lock; therefore, the stream monitoring
exit must not release the local lock. If the stream monitoring exit
releases the local lock, unpredictable serialization problems within Session Manager
can occur.
- Determine how long it takes a command to run or determine at what
time certain operations were performed.
The stream monitoring exit
receives a time stamp with each line that it receives. You can use
the time stamp to: - Monitor the length of time it takes for particular commands to
run
The stream monitoring exit can monitor the input. When it
intercepts a specific command, it can save the time stamp and begin
monitoring the output. When it detects the READY mode message, it
can determine how long the command took to execute by calculating
the difference between the saved time stamp and the time stamp provided
with the READY mode message line.
- Provide a time stamp on lines that you save for subsequent hard
copy listings.
If you save a TSO/E session for subsequent hard
copy, you can convert the time stamp that the stream monitoring exit
receives for each line to a time stamp that can be printed. You can
then include this with each line. When you review the session in
hard copy, you can see the time at which certain operations were performed.
|