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:

  • alertSubject - Subject for alert message. A system default message is used if you do not define one in the agent procedure. See System Parameters below.
  • alertBody - Body for alert message. A system default message is used if you do not define one in the agent procedure. See System Parameters below.
  • alertDisableAlarm - When a default alarm enabled, enter any value to disable.
  • alertGenerateTicket - Enter any value to generate.
  • alertScriptName - Valid agent procedure name to execute on current machine.
  • alertEmailAddressList - Comma-separated email addresses. Required to send email.
  • alertAdminNameList - Comma-separated list of VSA user names. Required to send messages to the Info Center > Inbox.
  • alertNotificationBarList - Comma-separated list of VSA user names. Required to send messages to the System notifications and alerts.
  • alertNotificationBarMasterAdmins - Enter any value to send notifications to the Notification Bar for all master users.

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.

  • <<id>> - Machine display name on which the agent procedure is being executed.
  • <<gr>> - Machine group name on which the agent procedure is being executed.
  • <<at>> - Alert date/time (server time).
  • <<ata>> - Alert date/time (agent time).
  • <<apn>> - Agent procedure name being executed.

Custom Parameters

You can embed custom parameters in alertSubject and alertBodygetVariable() 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 alertBodygetVariable() commands. Examples include:

  • #filename#
  • #logentry#
  • #registrykey#
  • #registryvalue#

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:
  • Constant Value
  • Procedure terminated. Could not access 'File Server 123'.
  • runTimeVar
  • All Operating Systems
  • Continue on Fail
  1. 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:
  • Constant Value
  • This alert was generated by <<apn>> on machine <<id>> at <<ata>>: #runTimeVar#.
  • alertBody
  • All Operating Systems
  • Continue on Fail
  1. 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")