The vSphere alarm infrastructure supports automating actions and sending different types of notification in response to certain server conditions. Many Alarms exist by default on vCenter Server systems. You can also create alarms yourself. For example, an Alarm can send an alert email message when CPU usage on a specific virtual machine exceeds 99% for more than 30 minutes.
The AlarmManager is the service interface for creating, setting, and managing alarms. You create an alarm, specifying trigger conditions and the action to take. When the conditions defined for the
Alarm occur on the system, the
Action specified for the alarm starts. The alarm also generates an
Event that is posted to the
Event history database. In addition, the action initiated by the
Alarm might also post a second
Event to the database, depending on the
Action type.
Use the AlarmManager. GetAlarm method to obtain an array of references to all
Alarm managed objects defined for a specific managed entity. When you call the method, you can pass in an optional reference to a managed entity. Without a reference to a managed entity, the
GetAlarm operation returns all
Alarm objects for all entities that are visible to the principal associated with the session invoking the operation.
The Alarm.
info property is an
AlarmInfo data object. You can obtain information about active
Alarms by collecting the properties of the
AlarmInfo data object.
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.