NET/MASTER RMS Management and Operations Guide

Adding a Time-Based Rule
Creating and Developing Rulesets and Rules
5–60 115415 NonStop NET/MASTER RMS Management and Operations Guide
INTCMD ‘opsys status snax lu‘ &ZZZMSUBJECT
INTREAD VARS=(*(4),&state)
IF &STATE == ‘Up’ THEN /* Recovery was successful */
/* Terminate with return code 0 */
EXIT 0
ELSE /* Recovery failed */
IF &$RETRY <= 5 THEN /* There will be retry left */
DO
/* Assign text of message to be delivered */
&SYSMSG = ‘AUTO RECOVERY OF’ &ZZZMSUBJECT ‘FAILED.’,
‘RETRY in 30 SECS’
/* Assign retry delay */
&$RETRYDELAY = 30
/* Terminate with return code 4 */
EXIT 4
END
ELSE
/* Reached retry limit - Do not retry */
DO
/* Assign text of message to be delivered */
&SYSMSG = ‘AUTO RECOVERY of ‘ &ZZZMSUBJECT ‘FAILED’,
‘AFTER’ &$RETRY ‘ATTEMPTS’
/* Terminate with return code 16 */
EXIT 16
END
end recover_snax_lu
If the NCL procedure does not start the subject successfully, the NCL procedure retries
the subject recovery five times, with a time delay of 30 seconds between each retry.
When the retry limit is reached, a message is displayed indicating that the automatic
recovery has failed.
Adding a Time-Based
Rule
You can add a time-based rule to a ruleset. RMS loads a time-based rule as a timer.
There are the following two types of time-based rules:
Global rules that operate independently of any message handler. You can create a
special ruleset for these rules. RMS loads global time-based rules when one of the
following occurs:
Each time NonStop NET/MASTER MS starts up
When you explicitly load the rule
Rules that operate when requested by a message action or group rule within the
same ruleset. You can add these rules dynamically when a message handler is
using the ruleset and make the rules available to the handler immediately.
Use a time-based rule to automate tasks at specific times. You specify a user ID to
determine which user has control of the rule actions. Figure 5-6 shows the panels
encountered when adding a time-based rule to a ruleset.