Creating an Alarm

You create an alarm with the
AlarmManager.CreateAlarm
method. In the simplest case, you specify the trigger condition in the
AlarmSpec.expression
property and the action to perform in the
AlarmSpec.action
property. When the expression evaluates to
true
, the alarm performs the action.
Figure 1 shows the
CreateAlarm
method.
CreateAlarm Method Inputs and Outputs
Shows inputs of Alarm Manager, including Managed Entity and Alarm Spec, to
						create an Alarm.
The following steps show how to create an alarm.
  1. Obtain a managed object reference to the
    AlarmManager
    associated with the vCenter Server.
  2. Obtain a managed object reference of the entity on which you want to set the
    Alarm
    .
  3. Create an
    AlarmSpec
    data object and specify the alarm details in its properties. See Defining Alarms Using the AlarmSpec Data Object.
  4. Call
    AlarmManager.CreateAlarm
    , passing in the references and the
    AlarmSpec
    data object. The system returns a managed object reference to the
    Alarm
    (see Figure 1).
The state of an alarm is contained in an
AlarmState
data object.