In the vSphere Client you define alarms in the alarm definition wizard. You access the alarm definition wizard from the Configure tab, under More.

Create or Edit Alarms

To monitor your environment, you can create alarm definitions in the vSphere Client . You can access alarm definitions in the Configure tab.

Create alarms in the Configure tab.

Prerequisites

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

Procedure

  1. Select an inventory object, click the Configure tab, and click More.
  2. Click Alarm Definitions.
  3. Click Add to add an alarm.
  4. Select an alarm, click Enable to activate an alarm.
  5. Select an alarm, click Disable to deactivate an alarm.
  6. Select an alarm, click Delete to delete an alarm.
  7. Click Edit to edit an alarm.
  8. You can also edit an alarm definition by selecting Monitor > Triggered Alarms
    1. Select an alarm listed under Alarm Name.
    2. Click Edit Alarm Definition to edit an alarm.

Specify Alarm Name, Description, and Target

Settings of an alarm definition include alarm name, description, and target.

Prerequisites

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

Procedure

  1. Type a name and description.
  2. Select the type of inventory object that this alarm monitors from the Target type drop-down menu

    Depending on the type of target that you choose to monitor, the summary that follows the Target, change.

  3. Click Next.
    Note: Depending on the type of activity that you choose to monitor, the options on the Alarm Rule page, change.

Results

Set alarm rule.

Specify Alarm Rules

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 Serverinstance, 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
      Starting with vCenter Server 8.0, the owner of the script must have vpxuser privileges :
      chown vpxd /var/myscripts/myAlarmActionScript

      For more information about scripts which require root user privileges, see Knowledge Base articleKB 87918.

  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.

Specify Alarm Reset Rules

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

You can set the Alarm Reset Rule

Prerequisites

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

Procedure

  1. Enable the Reset the alarm to green option.
  2. 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.
  3. 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.
  4. Select an operator from the drop-down menu.
  5. 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.
  6. To send traps when alarms are triggered on a vCenter Server instance, enable Send SNMP traps.
  7. Run scripts
    1. To run scripts when alarms are triggered, enable Run script.
    2. In Run this script column, type script or command information:
      For this type of command... Enter this...
      EXE executable files Full pathname of the command. For example, to run the cmd.exe command in the C:\tools directory, type:

      c:\tools\cmd.exe.

      BAT batch file Full pathname of the command as an argument to the c:\windows\system32\cmd.exe command. For example, to run the cmd.bat command in the C:\tools directory, type:

      c:\windows\system32\cmd.exe /c c:\tools\cmd.bat.

      Note: The command and its parameters must be formatted into one string.
      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:
      c:\tools\cmd.exe {alarmName} {targetName}
      c:\windows\system32\cmd.exe /c c:\tools\cmd.bat {alarmName} {targetName}
      The script can run on any platform. You must provide the path to the script and argument keys. For example:
      /var/myscripts/myAlarmActionScript {alarmName} {targetName}
  8. (Optional) Configure alarm transitions and frequency.
  9. Select an advanced action from the Add Advanced Actions drop-down menu.
    You can add multiple advanced actions for an alarm reset rule. You can define the advanced actions for virtual machines 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.
  10. (Optional) Configure frequency for advanced actions.
  11. Click Add Another Rule to add an additional reset rule for an alarm.
  12. Click Duplicate Rule to create an identical reset rule for an alarm.
  13. Click Remove Rule to remove an existing reset rule set for an alarm.

Example

Click Next to review the alarm definition.

Review and Enable Alarm

You can review and enable the alarm in the vSphere Client

After setting the alarm rule, review the alarm before enabling the alarm.

Prerequisites

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

Procedure

  1. Review the Alarm Name, Description, Targets, and Alarm Rule.
  2. (Optional) Configure alarm transitions and frequency.
  3. Select Enable this alarm to enable the alarm.

Results

The alarm is enabled.