Specifying Alarm Actions
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.- TheAlarmTriggeringActiondata object has anactionproperty and atransitionSpecsproperty.AlarmTriggeringActionTransitionSpecallows you to define a starting state and a final state for theAlarm. You can limit the number ofAlarmobjects actually triggered to a singleAlarmby specifyingfalsefor therepeatsproperty of theAlarmTriggeringActionTransitionSpec.
- TheGroupAlarmActiondata object is an array version of theAlarmActionbase type. You can create a singleAlarmActioninstance or an array ofAlarmActioninstances 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 aMethodActiondata object.
- Running a Script. To run a script, create an instance of theRunScriptActiondata 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 theSendEmailActiondata object.AlarmAction and Related Objects
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 ofMethodArgumentActiondata objects.Depending on the entity associated with the alarm, theMethodAction.argumentproperty might not be needed.