General examples of AOEXEC ALERT


This section provides examples of using the AOEXEC ALERT command. A brief discussion follows each example.

Example 1: Creating a multiline ALERT

REXX EXEC example:

"AOEXEC ALERT KEY(NETW2) ",
  "TEXT(’COMMUNICATION LINES DOWN: /N - DALLAS /N - CHICAGO’) ",
  "FUNCTION(ADD) QUEUE(NETWORK) ",
  "PRIORITY(CRITICAL) COLOR(PINK) SSID(RE61)"

CLIST example:

AOEXEC ALERT KEY(NETW2) +
  TEXT('COMMUNICATION LINES DOWN: /N - DALLAS /N - CHICAGO') +
  FUNCTION(ADD) QUEUE(NETWORK) +
  PRIORITY(CRITICAL) COLOR(PINK) SSID(RE61)

ALERTs are created as single-line messages unless you use the characters /N in the ALERT text parameter. The characters /N indicate the beginning of a new line of ALERT text.

You must use a blank space before and after /N. In the example above, the ALERT text parameters includes the use of /N in two places. The EXEC command in this example produces t he following multiline ALERT:

___ 11:43 CHICAGO COMMUNICATION LINES DOWN:
- DALLAS
- CHICAGO

Example 2: Associating a help panel with an ALERT

REXX EXEC example:

"AOEXEC ALERT KEY(NETW1) ",
  "TEXT(’ALM0100 - 8100 COMMUNICATION LINE DOWN: /N - CHI998A21’) ",
  "FUNCTION(ADD) QUEUE(NETWORK) PRIORITY(WARNING) HELP(H8100) ",
  "COLOR(RED) SSID(RE61)"

CLIST example:

AOEXEC ALERT KEY(NETW1) +
  TEXT('ALM0100 - 8100 COMMUNICATION LINE DOWN: /N - CHI998A21') +
  FUNCTION(ADD) QUEUE(NETWORK) PRIORITY(WARNING) HELP(H8100) +
  COLOR(RED) SSID(RE61)

Prior to using the HELP keyword in the AOEXEC ALERT command, you must create and add the help panel to BBPLIB. The HELP keyword specifies the name of the BBPLIB member name. The example shows an AOEXEC ALERT command statement that specifies a help panel named H8100.

The ALERT created by the EXEC appears on the ALERT DETAIL panel in the following format:

TIME  IND ORIGIN _______________________________________
11:44 h   CHICAGO  ALM0100 8100 COMMUNICATION LINE DOWN:
                         -CHI998A21

The ALERT is displayed with an h in the IND column. This h indicates that a help panel is associated with the ALERT.

To access the help panel, place the cursor anywhere on the ALERT text and press the PF key assigned to EXPAND. You can also type EXPAND on the COMMAND line and then place the cursor anywhere on the ALERT text and press Enter.

Example 3: Managing ALERT queues

REXX EXEC example:

/* REXX */
"AOEXEC VGET VAR(THRSHOLD) SSID(RE61)"
"AOEXEC ALERT FUNCTION(COUNT) QUEUE(NETWORK) SSID(RE61)"
n=amfcount
do while n > 0
  "AOEXEC ALERT FUNCTION(READQ) QUEUE(NETWORK) POSITION("N") SSID(RE61)"
  if rc=0 then do
    if amfudata > thrshold then do
      "AOEXEC ALERT KEY("amfkey") FUNCTION(DELETE) QUEUE(NETWORK)
SSID(RE61)"
      "AOEXEC ALERT KEY("amfkey") FUNCTION(ADD) TEXT('"amftext"')
QUEUE(SUPERVSE)",
      "SSID(RE61)"
    END
  END
  n = n - 1
END

CLIST example:

PROC 0
AOEXEC VGET VAR(THRSHOLD) SSID(RE61)
AOEXEC ALERT FUNCTION(COUNT) QUEUE(NETWORK) SSID(RE61)
SET N=&AMFCOUNT
DO WHILE N > 0
  AOEXEC ALERT FUNCTION(READQ) QUEUE(NETWORK) POSITION(&N) SSID(RE61)
  IF &LASTCC = 0 THEN DO
    IF &AMFUDATA GT &THRSHOLD THEN DO
      AOEXEC ALERT KEY(&AMFKEY) FUNCTION(DELETE) QUEUE(NETWORK) SSID(RE61)
      AOEXEC ALERT KEY(&AMFKEY) FUNCTION(ADD) TEXT('&AMFTEXT')
      QUEUE(SUPERVSE) SSID(RE61)
    END
  END
  SET N = &N - 1
END

You can periodically check the queues for ALERTs that have not been responded to and escalate their priority.

In the above EXEC, the READQ function is used to set AMFCOUNT equal to the number of ALERTs in the NETWORK queue. The EXEC then reads each ALERT from the NETWORK queue using POSITION and tests the user data presented in the AMFUDATA variable.

If the criteria is met, the ALERT is deleted from the NETWORK queue by using the AMFKEY variable (the key of the ALERT). Then the ALERT is added to the supervisor's queue by using the same key and the original text in the AMFTEXT variable.

Warning

Note

This example assumes that the ALERTs were originally created with some meaningful user data (such as the date and time).

The following sections show examples of ALERT escalation:

Related topic

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*

BMC AMI Ops Automation 8.3.01