Being able to issue commands from OCS is an important part of controlling your regions. From OCS you can issue commands to the background processes of your product, and you can set commands to issue automatically, based on a specified time.
Background environments are internal to your system and services. They process commands submitted to them by users and support system level procedures such as LOGPROC. Each background process has a user ID, but is not associated with any physical terminal.
The following background environments are available:
Background system environment
Background monitor environment
Background server environment
Background logger environment
You can send commands to these environments for them to execute, as if they were real OCS users by using the SUBMIT command. You can submit commands or NCL procedures. For example, if you want the background system environment to start the procedure MONPROC, enter the following command:
SUBMIT BSYS START MONPROC
After a command is submitted, its processing is managed by that environment. It is not affected if you log off or leave OCS, and its command authority remains the same as the user ID of the submitter.
Background environment processing is ideal for monitoring an NCL procedure that regularly checks the status of network components. Commands directed to the Background Monitor route the command and its results to all monitor status terminals logged on to the system, and to the activity log. Commands directed to the Background Logger for execution log the command and its results only.
Timer commands can also be routed to background environments by the SUBMIT command or by the ROUTE operand for the timer command being issued.
You can issue commands at specified times and at specified intervals. These commands are known as timer-initiated commands. The following timer-initiated commands are available:
Executes commands at a specified time of day. Timer commands use a 24-hour clock with the format hh.mm.ss.
Limits: 24.00.00 (midnight)
Repeats commands at a given time frequency.
Default: 10 seconds
Timer commands can be entered in OCS, or included in NCL procedures.
A maximum of 9999 concurrent timer commands is supported, and this maximum is the default.
If you log off after issuing a timer command, that command is not executed. However, you can use the ROUTE or KEEP operand when you enter an AT command to specify another user to issue the command in your place. This feature allows you to sign off and have the results of the command returned to you when you sign on again.
The ROUTE and KEEP options are ideal if you are including timer commands for specific operators in the system initialization procedures that are executed automatically during startup.
Timer commands can also be specified with a limit to the number of times they can execute before being automatically purged.
Example: Monitor Users at a Specified Interval
To monitor the users that are logged on to the system every half hour, enter the following command:
EVERY .30 CMD=SHOW USERS
Also, if you want to remind users of a three o’clock meeting one hour before it starts, enter the following command:
AT 14.00 MSG ALL DON’T FORGET MEETING AT 15.00
When a timer command executes, the command text is echoed on all applicable terminals as if the command had been entered from those terminals. A unique timer ID prefixes the command text echo and has the following format:
#nnnn command_text
You can display pending timer commands by using the SHOW TIMER command. By default, this command lets you display any timer commands initiated by your user ID. However, by specifying the ALL operand you can display all outstanding timer commands on your system.
Example: Display Active Timer Commands
To find out what timer commands you have initiated, enter the following command:
SHOW TIMER
Using the example given above, the following is displayed:
ID BY INTERVAL -USERID-R LIM CNT K/P ENV P/M TID NEXT
4 EV 00:30:00 USER01 0 0 NO PRI YES - 12:29:48
CMD=SHOW USERS
5 AT 14:00:00 USER01 0 0 NO PRI YES - 14:00:00
CMD=MSG ALL DON'T FORGET MEETING AT 15.00
NUMBER OF TIMER COMMANDS DISPLAYED WAS 2.
When you initiate a timer command, the system allocates a unique four-digit number known as the timer ID, or purge ID. This number prefixes all displays resulting from that command, and must be used when manually deleting a timer command.
To delete a timer command manually, use the PURGE command.
To delete a timer command created by another user, you require a command authority level of 2 or higher.
Example: Delete Command
To delete an AT timer command, enter the following command:
PURGE TIMER=5
The value 5 is the purge ID assigned to the AT command.
By default, your timer commands remain active only while you are logged onto the system. Before each attempt to execute the command, the system checks that you are still logged on.
If you are no longer logged on to your system, the timer command is automatically deleted, without further execution.
If you want your timer-initiated commands to continue to execute after you log off, you can redirect the command results to the background logger, background monitor, or the system background environment.
To redirect the timer command, specify an AT or EVERY command with the KEEP operand.
By default, the KEEP operand requires a command authority level of 2 or higher.
Example: Redirect Timer Commands
To redirect the SHOW USERS command for execution by the background system environment, enter the following command:
EVERY .30 KEEP=SYS CMD=SHOW USERS
If the KEEP operand is in use, the execution of timer commands continues irrespective of whether you are logged on to the region.
When defining a timer command, you can use the LIMIT operand to specify a limit on the number of times the command is executed. When this limit is reached, the command is automatically purged.
The limit you assign and the number of times a command has already executed are displayed by the SHOW TIMER command.
Example: Limit Timer Command Execution
To limit the number of times the SHOW USERS command is executed to 5, enter the following command:
EVERY .30 LIMIT=5 CMD=SHOW USERS
When the SHOW USERS command has been executed five times, the timer command is deleted.
The ROUTE operand lets you direct a command for execution under another user ID—the target user ID. The operand requires a command authority level of at least 2.
With this option, the timer command is retained even if the target user ID is not logged on. Command execution is bypassed and the time interval reset. The command is attempted again only after the time interval has again elapsed.
Example: Execute Timer Command Under Another User ID
If you want USER02 to execute the SHOW USERS command, enter the following command:
EVERY .30 ROUTE=USER02 CMD=SHOW USERS
Concatenated commands can be specified in the command text for a timer command. Separate each command in the concatenation with a colon (:). These are internally translated into normal concatenation characters, that is, semicolons (;), before execution.
| Copyright © 2012 CA. All rights reserved. |
|