You specify the actions that the system should take by setting the action property of the AlarmSpec data object to the AlarmAction data object defined for the purpose.

The AlarmAction data object is an abstract type that has two descendent objects.

  • The AlarmTriggeringAction data object has an action property and a transitionSpecs property. AlarmTriggeringActionTransitionSpec allows you to define a starting state and a final state for the Alarm. You can limit the number of Alarm objects actually triggered to a single Alarm by specifying false for the repeats property of the AlarmTriggeringActionTransitionSpec.
  • The GroupAlarmAction data object is an array version of the AlarmAction base type. You can create a single AlarmAction instance or an array of AlarmAction instances to take effect when the conditions specified for your alarm are met on the system.

The system can respond to an alarm in several ways:

  • Invoking an operation. To invoke an operation, create a MethodAction data object.
  • Running a Script. To run a script, create an instance of the RunScriptAction data object that specifies the fully qualified path to the shell script on the vCenter Server.
  • Send an email message. To send an email message to a system administrator, use the SendEmailAction data object.
    Figure 1. AlarmAction and Related Objects
    Shows data objects related to Alarm Action, especially Alarm Triggering Action.

For example, you can use the MethodAction data object type to invoke an operation on the server. The MethodAction data object contains the following properties:

  • name—Name of the operation that you want to invoke at the scheduled time.
  • argument—Specifies required parameters, if any, as an array of MethodArgumentAction data objects.

    Depending on the entity associated with the alarm, the MethodAction.argument property might not be needed.