Next Topic

Previous Topic

Book Contents

sendAlert()

This step command takes no parameters. Instead one or more getVariable() steps—run prior to the sendAlert() step—specify alert action variables that determine the actions triggered by the sendAlert() step. All alert action variables are optional. If no alert action variables are defined, an alarm will be created with a system default message. An alert action variable can be used to disable the default alarm action. Alert action variables, if used, must use the specific names corresponding to their actions:

System Parameters

You can override the default alertSubject and alertBody text sent by the sendAlert() command. If you do you can embed the following system parameters in the alertSubject and alertBody variables you create using getVariable() commands. Double angle brackets are required when embedding them in text. You do not create these embedded system parameters using a getVariable() command. They are always available.

Custom Parameters

You can embed custom parameters in alertSubject and alertBody getVariable() commands. First, create another variable using the getVariable() command. The value stored with this first variable can be dynamic, determined when the agent procedure is run. Second, insert the name of this first variable—surrounded by # and # brackets—into the text value specified by the alertSubject and alertBody getVariable() commands. Examples include:

Specifying getVariable() Commands before sendAlert() in an Agent Procedure

For example, assume an agent procedure:

  1. Creates a variable called runTimeVar using the getVariable() command. The values entered are:
  2. Then a second getVariable() command is created in the same agent procedure. This second getVariable() command specifies the body of a sendAlert() message. This body message embeds both system and custom parameters. The values entered for this second getVariable() command are:
  3. Finally the sendAlert() command is run and the alert message is created.

Note: The sequence of parameter variables and alert action variables does not matter. But all of them have to run before the sendAlert() command that makes use of them.

Example

getVariable("Constant Value", "Procedure terminated. Could not access 'File Server 123'.", "runtimeVar, "All Operating Systems", "Halt on Fail")
getVariable("Constant Value", "This alert was generated by <<apn>> on machine <<id>> at <<ata>>: #runTimeVar#.", "alertBody", "All Operating Systems", "Halt on Fail")
sendAlert("All Operating Systems", "Halt on Fail")