With PowerCLI, you can create and modify vSphere alarm actions and alarm triggers.

Connect to a vSphere server.

1

For all host alarms, modify the interval after the action repeats.

Get-AlarmDefinition -Entity (Get-VMHost) | foreach { $_ | Set-AlarmDefinition -ActionRepeatMinutes ($_.ActionRepeatMinutes + 1)}
2

Modify the name and the description of a specified alarm definition, and enable the alarm.

Get-AlarmDefinition -Name AlarmDefinition | Set-AlarmDefinition -Name AlarmDefinitionNew -Description 'Alarm Definition Description' -Enabled:$true
3

Create an alarm action email for the renamed alarm definition.

Get-AlarmDefinition -Name AlarmDefinitionNew | New-AlarmAction -Email -To 'test@vmware.com' -CC @('test1@vmware.com', 'test2@vmware.com') -Body 'Email text' -Subject 'Email subject'
4

Create an snmp alarm action.

Get-AlarmDefinition -Name AlarmDefinitionNew | New-AlarmAction -Snmp
5

Create a script alarm action.

Get-AlarmDefinition -Name AlarmDefinitionNew | New-AlarmAction -Script -ScriptPath 'c:\test.ps1'
6

Create an action trigger on all actions for the specified alarm.

Get-AlarmDefinition -Name AlarmDefinitionNew | Get-AlarmAction | New-AlarmActionTrigger -StartStatus 'Red' -EndStatus 'Yellow' -Repeat