You can select and configure the events, states, or conditions that trigger the alarm from the Alarm Rule page in the New Alarm Definition wizard.

An alarm definition must contain at least one trigger before you can save it.

Prerequisites

Required Privilege: Alarms.Create alarm or Alarms.Modify alarm

Procedure

  1. Select a trigger from the drop-down menu.
    The combined event triggers are displayed. You can set the rule for a single event only. You must create multiple rules for multiple events.
  2. Click Add Argument to select an argument from the drop-down menu.
    It supports ALL based expression, option to select ANY is not available. You must create a separate alarm definition for each trigger. The OR operator is not supported in the vSphere Client. However, you can combine more than one condition trigger with AND operator.
  3. Select an operator from the drop-down menu.
  4. Select an option from the drop-down menu to set the threshold for triggering an alarm
  5. Select severity of the alarm from the drop-down menu.
    You can set the condition to either Show as Warning or Show as Critical, but not for both. You must create a separate alarm definition for warning and critical status. Keep the target's current state option can be enabled only for an event based alarm condition. For example, if Cannot power off the VM and Keep the target's current state is selected for an alarm rule, then it cannot be combined with any other alarm rule with different severities like Warning or Critical. These alarms will not have reset rules as the alarm rule does not change the state of the target object.
  6. Send email notifications
    1. To send email notifications when alarms are triggered, enable Send email notifications.
    2. In the Email to, enter recipient addresses. Use commas to separate multiple addresses.
  7. To send traps when alarms are triggered on a vCenter Server instance, enable Send SNMP traps.
  8. Run scripts
    1. To run scripts when alarms are triggered, enable Run script.
    2. In Run this script column, enter the full path to the script.
      /var/myscripts/myAlarmActionScript
      You can use environment variables to define more complex scripts and attach them to multiple alarms or inventory objects so that the alarm action occurs when the alarm triggers.
      Table 1. Alarm Environment Variables
      Variable Name Variable Description Supported Alarm Type
      VMWARE_ALARM_NAME Name of the triggered alarm. Condition, State, Event
      VMWARE_ALARM_ID MOID of the triggered alarm. Condition, State, Event
      VMWARE_ALARM_TARGET_NAME Name of the entity on which the alarm triggered. Condition, State, Event
      VMWARE_ALARM_TARGET_ID MOID of the entity on which the alarm triggered. Condition, State, Event
      VMWARE_ALARM_OLDSTATUS Old status of the alarm. Condition, State, Event
      VMWARE_ALARM_NEWSTATUS New status of the alarm. Condition, State, Event
      VMWARE_ALARM_TRIGGERINGSUMMARY Multiline summary of the alarm. Condition, State, Event
      VMWARE_ALARM_DECLARINGSUMMARY Single-line declaration of the alarm expression. Condition, State, Event
      VMWARE_ALARM_ALARMVALUE Value that triggered the alarm. Condition, State
      VMWARE_ALARM_EVENTDESCRIPTION Description text of the alarm status change event. Condition, State
      VMWARE_ALARM_EVENTDESCRIPTION Description of the event that triggered the alarm. Event
      VMWARE_ALARM_EVENT_USERNAME User name associated with the event. Event
      VMWARE_ALARM_EVENT_DATACENTER Name of the datacenter in which the event occurred. Event
      VMWARE_ALARM_EVENT_COMPUTERESOURCE Name of the cluster or resource pool in which the event occurred. Event
      VMWARE_ALARM_EVENT_HOST Name of the host on which the event occurred. Event
      VMWARE_ALARM_EVENT_VM Name of the virtual machine on which the event occurred. Event
      VMWARE_ALARM_EVENT_NETWORK Name of the network on which the event occurred. Event
      VMWARE_ALARM_EVENT_DATASTORE Name of the datastore on which the event occurred. Event
      VMWARE_ALARM_EVENT_DVS Name of the vNetwork Distributed Switch on which the event occurred. Event
      If your script does not make use of the alarm environment variables, include any necessary parameters in the configuration field. Enclose parameters in curly brackets. For example:
      /var/myscripts/myAlarmActionScript {alarmName} {targetName}
      Check that the script can be executed:
      chmod +x /var/myscripts/myAlarmActionScript
  9. (Optional) Configure alarm transitions and frequency.
  10. Select an advanced action from the drop-down menu.
    You can define the advanced actions for virtual machine and hosts. These advanced actions are applicable only for virtual machines and hosts. There are different sets of advanced actions based on target types of virtual machines and hosts.
    You can add multiple advanced actions for an alarm.
  11. (Optional) Configure frequency for advanced actions.
  12. Click Add Another Rule to add an additional rule for an alarm.
  13. Click Duplicate Rule to create an identical rule for an alarm.
  14. Click Remove Rule to remove an existing rule set for an alarm.

What to do next

Click Next to set the Reset Rule.