AMS maintains two predefined variables to keep track of the status of actions at run time: _STATUS and _ERRORS. These variables are set for all actions, including actions on variables and actions executed with conditional logic.
The variable _STATUS contains the status of the last action executed. Therefore, if you want to use the status of a particular action in an action other than the next action, you must save the value of _STATUS in a user-defined variable.
The variable _ERRORS contains the number of action errors encountered while processing actions associated with the matched pattern.
You can use these variables when specifying additional actions based on the success or failure of previous actions.
_STATUS Values
The variable _STATUS can have one of the following values:
Value | Description |
0 | AMS successfully executed the action with no warnings. |
1 | AMS executed the action but issued a warning. |
-1 | AMS encountered an error and did not execute the action. |
Successful Action (0)
If AMS can evaluate and execute the action without error or warning, the action is considered successful. The variable _STATUS is set to zero to indicate that the action was executed successfully by AMS.
AMS Warnings (1)
Warnings identify situations you should investigate to determine whether there is a problem in your database, in another Operations Sentinel process, or with a managed host. In these situations AMS cannot execute the action exactly as defined in the database and makes assumptions about which actions are appropriate and executes them. A warning sets the variable _STATUS to 1 but does not increment the variable _ERRORS. Warnings that result from executed actions are logged but do not generate alarms or alerts. SP-AMS logs errors in the SP-AMS log and in the host log. CP‑AMS logs errors in the OS 2200 partition log file.
The warnings both SP-AMS and CP-AMS can issue include:
Target member already exists
If the targeted member of a CREATE action (see Section 4) already exists, the CREATE action is ignored.
Target member does not exist
If the target of a SET or RESET action (see Section 4) is a variable group member, and the member does not previously exist, the member is created and then set or reset.
If the targeted member of a DESTROY action (see Section 4) does not exist, the DESTROY action is ignored because there is no member to destroy.
Warnings [SP-AMS]
The warnings that only SP-AMS can issue include:
A COMMAND or PASSWORD action was not executed because of a communications problem.
Action ignored, host is currently not monitored.
A delayed action (specified with a WAIT clause) was about to be executed, but the host for which the action was intended is no longer managed by Operations Sentinel.
Event report not delivered
An EVENT-REPORT action was not executed because of a communications problem.
Host information unavailable
PASSWORD, COMMAND, and AC and DE type EVENT-REPORT actions require host specific information that is not available when matching the database activation or deactivation message. The action is ignored.
Activation in progress
A pattern in the autoaction database matches the database activation message or the automation initialization message at the same time that a database is being activated. The ACTIVATE or DEACTIVATE action specified in the matched pattern is ignored when database activation is already in progress.
Deactivation in progress
A pattern in the autoaction database matches the database deactivation message or the automation termination message at the same time that a database is being deactivated. The ACTIVATE or DEACTIVATE action (see 4.4. and 4.8) specified in the matched pattern is ignored when database deactivation is already in progress.
Warnings [CP-AMS]
The warnings that only CP-AMS can issue include:
Action text for a DISPLAY action that exceeds 69 characters is truncated and then displayed.
A hold-id for a HOLD or RELEASE action that exceeds 12 characters is truncated to 12 characters and used as the hold-id for the action.
Note: For all other actions, if the action text exceeds the maximum length, CP‑AMS issues an error instead of truncating the text and issuing a warning.
READ-AND-REPLY message already answered
If the read-and-reply message that an ANSWER action is to answer is no longer outstanding, CP-AMS ignores the ANSWER action.
Warnings are logged to trace log files and the host system log, using LG keyins, when in DEBUG mode.
Errors (-1)
Errors generate console alarms or alerts that AMS logs. In SP-AMS, errors are logged in the log SP-AMS and in the host log. CP-AMS logs errors to the OS 2200 system log file.
The two types of errors are minor and major. Minor errors affect only the action being executed; major errors affect the database. Most minor errors occur because text substitution has failed or because the action text that was substituted was not valid for the action type. Most major errors are caused by a corrupted database or a software failure.
Minor errors cause AMS to set the predefined variable _STATUS to -1 and to increment the predefined variable _ERRORS. AMS handles the results of minor errors depending on the type of action being executed, as follows:
IF and ELSEIF actions
AMS assumes that the result of the expression is false and continues processing the next associated ELSEIF, ELSE, or ENDIF clause.
SET, RESET, CREATE, and DESTROY actions
The value of the target variable is not changed.
All other actions are not executed
Major errors cause the processing of the action to be discontinued, and no further processing of actions is performed for the matched pattern. AMS discontinues pattern matching and deactivates the database. In this case, the normal database deactivation message is not processed and the values of all variables are lost.