Set-AlarmDefinition
This cmdlet modifies the specified alarm definitions.
Syntax
Parameters
Required | Parameter Name | Type | Position | Features | Description |
---|---|---|---|---|---|
required
|
AlarmDefinition | AlarmDefinition[] | named |
|
Specifies the alarm definition you want to modify. |
optional | ActionRepeatMinutes | Int32 | named |
|
Specifies a time period in minutes to define how often the alarm action repeats if the alarm is active. |
optional | AlarmAction | AlarmAction[] | named |
|
Specifies the alarm actions which you want to be executed when the alarm triggers. |
optional | AlarmTrigger | AlarmTrigger[] | named |
|
Specifies the alarm triggers which you can use to activate the alarm. |
optional | Description | String | named |
|
Specifies a new description for the alarm definition. |
optional | Enabled | Boolean | named |
|
Indicates that the alarm definition is enabled. |
optional | Name | String | named |
|
Specifies a new name for the alarm definition. |
optional | ProgressAction | ActionPreference | named |
|
|
optional | ReportingFrequencyMinutes | Int32 | named |
|
Indicates how often you want to trigger the alarm. It is measured in minutes. |
optional | ReportingTolerancePercentage | Int32 | named |
|
Indicates the tolerance range for the metric triggers. It is measured in percentage. |
optional | Server | VIServer[] | named |
|
Specifies the vCenter Server systems on which you want to run the cmdlet. If no value is provided or $null value is passed to this parameter, the command runs on the default servers. For more information about default servers, see the description of the Connect-VIServer cmdlet. |
Output
VMware.VimAutomation.ViCore.Types.V1.Alarm.AlarmDefinitionExamples
Example 1
Get-AlarmDefinition -Name 'alarms' | Set-AlarmDefinition -ActionRepeatMinutes ($_.ActionRepeatMinutes + 1)
Increases all selected alarms action repeat minutes.
Example 2
Get-AlarmDefinition -Name 'alarm' | foreach {$_ | Set-AlarmDefinition -Name 'alarm new name' -Description 'new description' -Enabled:$true}
Changes the name, description, and the Enabled flag of the selected alarms.
Example 3
$trigger = New-AlarmTrigger -StatePath "runtime.powerState" -Value "poweredOff" -EntityStatus Red -EntityType "VirtualMachine" -StateAlarmOperator Equal $action = New-AlarmAction -Snmp Get-AlarmDefinition -Name 'alarm' | Set-AlarmDefinition -Trigger $trigger -Action $action -ReportingFrequencyMinutes 20 -ReportingTolerancePercentage 10
Changes the triggers, actions, reporting frequency minutes, and reporting tolerance percentage of the selected alarm.
Related Commands
AlarmAction
This cmdlet retrieves the actions of the specified alarm definitions.
This cmdlet creates an alarm action and attaches it to the specified alarm.
This cmdlet removes an alarm action.
AlarmActionTrigger
This cmdlet retrieves the actions that trigger the specified alarm actions.
This cmdlet creates a new action trigger for the specified alarm action.
This cmdlet removes the alarm action triggers.
AlarmDefinition
This cmdlet retrieves the available alarm definitions.
This cmdlet creates a new alarm definition.
This cmdlet removes alarm definitions from the vSphere environment.
This cmdlet modifies the specified alarm definitions.
AlarmTrigger
This cmdlet retrieves alarms triggers.
This cmdlet adds ? new alarm trigger to the existing alarm or creates ? new alarm trigger.
AlarmTriggerArgument
This cmdlet creates a new AlarmTriggerArgument local object that defines the condition comparison under which an alarm is triggered. The AlarmTriggerArgument object is used as the Arguments parameter in the New-AlarmTrigger cmdlet.
AlarmTriggerArgumentAttributeName
This cmdlet fetches a list of attribute names of the alarm trigger argument for the "vsan.health.ssd.endurance" event type. (The most of attribute names for alarm trigger argument can be fetched by Get-EventType)