< Back

Set-AlarmDefinition

Sun Jan 19, 2020 7:06 pm

NAME Set-AlarmDefinition



SYNOPSIS

This cmdlet modifies the specified alarm definitions.





SYNTAX

Set-AlarmDefinition [-AlarmDefinition] <AlarmDefinition[]> [-ActionRepeatMinutes <Int32>] [-Description <String>]

[-Enabled <Boolean>] [-Name <String>] [-AlarmAction <AlarmAction[]>] [-AlarmTrigger <AlarmTrigger[]>]

[-ReportingFrequencyMinutes <Int32>] [-ReportingTolerancePercentage <Int32>] [-Server <VIServer[]>] [-Confirm]

[-WhatIf] [<CommonParameters>]





DESCRIPTION

This cmdlet modifies the specified alarm definitions.





PARAMETERS

-ActionRepeatMinutes <Int32>

Specifies a time period in minutes to define how often the alarm action repeats if the alarm is active.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-AlarmDefinition <AlarmDefinition[]>

Specifies the alarm definition you want to modify.



Required? true

Position? 1

Default value None

Accept pipeline input? True (ByValue)

Accept wildcard characters? false



-Description <String>

Specifies a new description for the alarm definition.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-Enabled <Boolean>

Indicates that the alarm definition is enabled.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-Name <String>

Specifies a new name for the alarm definition.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-AlarmAction <AlarmAction[]>

Specifies the alarm actions which you want to be executed when the alarm triggers.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-AlarmTrigger <AlarmTrigger[]>

Specifies the alarm triggers which you can use to activate the alarm.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-ReportingFrequencyMinutes <Int32>

Indicates how often you want to trigger the alarm. It is measured in minutes.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-ReportingTolerancePercentage <Int32>

Indicates the tolerance range for the metric triggers. It is measured in percentage.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-Server <VIServer[]>

Specifies the vCenter Server systems on which you want to run the cmdlet. If no value is given to this

parameter, the command runs on the default servers. For more information about default servers, see the

description of the Connect-VIServer cmdlet.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? true



-Confirm [<SwitchParameter>]

If the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false,

the cmdlet runs without asking for user confirmation.



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-WhatIf [<SwitchParameter>]

Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are

modified.



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS



OUTPUTS

Zero or more modified AlarmDefinition objects







NOTES









-------------------------- 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 LINKS

Online Version: https://code.vmware.com/doc/preview?id= ... ition.html

Get-AlarmAction

Get-AlarmActionTrigger

Get-AlarmDefinition

Get-AlarmTrigger

New-AlarmAction

New-AlarmActionTrigger

New-AlarmDefinition

New-AlarmTrigger

Remove-AlarmAction

Remove-AlarmActionTrigger

Remove-AlarmDefinition

Set-AlarmDefinition

Get-Metric

Get-EventType