Alarm Category | Vmware PowerCLI Reference

Alarm Category

Cmdlets are usually implemented around resource operations. The four basic operations are CREATE, READ, UPDATE and DELETE. This set of operations is known as CRUD. Most of the cmdlets support CRUD which are respectively cmdlets that start with the New/Get/Set/Remove cmdlet verbs but they also may have additional operations

Step 1: Retrieve a object by running a Get command

You can READ objects by using Get-AlarmAction cmdlet. See example below:

# Extract all PowerCLI supported alarm actions for the default alarm "Host processor status".

Get-AlarmDefinition -Name "Host processor status" | Get-AlarmAction -ActionType "ExecuteScript", "SendSNMP", "SendEmail"

Step 2 : Run commands from the CRUD group

You can CREATE objects by using New-AlarmAction cmdlet. See example below:

# Creates an alarm action SNMP and attaches it to the specified alarm.

Get-AlarmDefinition -Name "Alarm1" | New-AlarmAction -Snmp
You can UPDATE objects by using Set-AlarmDefinition cmdlet. See example below:

# Increases all selected alarms action repeat minutes.

Get-AlarmDefinition -Name 'alarms' | Set-AlarmDefinition -ActionRepeatMinutes ($_.ActionRepeatMinutes + 1)
You can REMOVE objects by using Remove-AlarmAction cmdlet. See example below:

# Removes all actions for an alarm definition.

Get-AlarmDefinition -Name "Alarm1" | Get-AlarmAction | Remove-AlarmAction -Confirm:$false

Step 3: Explore More Related Commands:

Get-AlarmActionTrigger This cmdlet retrieves the actions that trigger the specified alarm actions.
Get-AlarmDefinition This cmdlet retrieves the available alarm definitions.
Get-AlarmTrigger This cmdlet retrieves alarms triggers.
New-AlarmActionTrigger This cmdlet creates a new action trigger for the specified alarm action.
New-AlarmDefinition This cmdlet creates a new alarm definition.
New-AlarmTrigger This cmdlet adds ? new alarm trigger to the existing alarm or creates ? new alarm trigger.
Remove-AlarmActionTrigger This cmdlet removes the alarm action triggers.
Remove-AlarmDefinition This cmdlet removes alarm definitions from the vSphere environment.