< Back

New-AlarmTrigger

Sun Jan 19, 2020 6:59 pm

NAME New-AlarmTrigger



SYNOPSIS

This cmdlet adds ? new alarm trigger to the existing alarm or creates ? new alarm trigger.





SYNTAX

New-AlarmTrigger -AlarmDefinition <AlarmDefinition[]> [-Confirm] [-EntityStatus {Gray | Green | Yellow | Red |

Unknown}] -EntityType <String> [-Server <VIServer[]>] -StateAlarmOperator {Equal | NotEqual | Unknown} -StatePath

<String> -Value <String> [-WhatIf] [<CommonParameters>]



New-AlarmTrigger -AlarmDefinition <AlarmDefinition[]> [-Confirm] [-EntityStatus {Gray | Green | Yellow | Red |

Unknown}] -EntityType <String> -EventType <EventType> [-Server <VIServer[]>] [-WhatIf] [<CommonParameters>]



New-AlarmTrigger -AlarmDefinition <AlarmDefinition[]> [-Confirm] -EntityType <String> -Metric <Metric>

-MetricAlarmOperator {Above | Below | Unknown} [-Red <Int32>] [-RedIntervalSeconds <Int32>] [-Server <VIServer[]>]

[-WhatIf] [-Yellow <Int32>] [-YellowIntervalSeconds <Int32>] [<CommonParameters>]



New-AlarmTrigger [-Confirm] [-EntityStatus {Gray | Green | Yellow | Red | Unknown}] -EntityType <String> [-Server

<VIServer[]>] -StateAlarmOperator {Equal | NotEqual | Unknown} -StatePath <String> -Value <String> [-WhatIf]

[<CommonParameters>]



New-AlarmTrigger [-Confirm] [-EntityStatus {Gray | Green | Yellow | Red | Unknown}] -EntityType <String>

-EventType <EventType> [-Server <VIServer[]>] [-WhatIf] [<CommonParameters>]



New-AlarmTrigger [-Confirm] -EntityType <String> -Metric <Metric> -MetricAlarmOperator {Above | Below | Unknown}

[-Red <Int32>] [-RedIntervalSeconds <Int32>] [-Server <VIServer[]>] [-WhatIf] [-Yellow <Int32>]

[-YellowIntervalSeconds <Int32>] [<CommonParameters>]





DESCRIPTION

This cmdlet adds an alarm trigger to the existing alarm or creates a new alarm trigger. The newly added or created

triggers could be Event, Metric, and State. The cmdlet returns the added or created trigger. To specify a server

that is different from the default one, use the Server parameter.





PARAMETERS

-AlarmDefinition <AlarmDefinition[]>

Specifies the existing alarm to which you want to add the trigger.



Required? true

Position? named

Default value None

Accept pipeline input? True (ByValue)

Accept wildcard characters? false



-Confirm [<SwitchParameter>]

Prompts you for confirmation before running the cmdlet.



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-EntityStatus <EntityStatus>

Specifies the trigger status. The allowed values for the Metric and State triggers are Red and Yellow.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-EntityType <String>

Specifies the type of object on which the event occurs, its containing state or metric. ?he valid PowerCLI

type names are VirtualMachine, VMHost, and so on.



Required? true

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-EventType <EventType>

Specifies the event to trigger on. You can find the event types by using the Get-EventType cmdlet.



Required? true

Position? named

Default value None

Accept pipeline input? True (ByValue)

Accept wildcard characters? false



-Metric <Metric>

Specifies the metric to trigger on. You can find the metrics by using the Get-Metric cmdlet.



Required? true

Position? named

Default value None

Accept pipeline input? True (ByValue)

Accept wildcard characters? false



-MetricAlarmOperator <MetricAlarmOperator>

Specifies the operation of the target metric.



Required? true

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-Red <Int32>

Specifies the threshold value that triggers a red status.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-RedIntervalSeconds <Int32>

Specifies the time interval for which the red condition must be true before the red status is triggered. If

unset, the red status is triggered immediately when the red condition becomes true.



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



-StateAlarmOperator <StateAlarmOperator>

Specifies the operation of the target state.



Required? true

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-StatePath <String>

Specifies the path of the state property. Supported values for the VirtualMachine type: runtime.powerState,

summary.quickStats.guestHeartbeatStatus. Supported values for the VMHost type: runtime.connectionState. And so

on.



Required? true

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-Value <String>

Specifies the condition of the state path.



Required? true

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-WhatIf [<SwitchParameter>]

Shows what would happen if the cmdlet runs. The cmdlet is not run.



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-Yellow <Int32>

Specifies the threshold value that triggers a yellow status.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-YellowIntervalSeconds <Int32>

Specifies the time interval for which the yellow condition must be true before the yellow status is triggered.

If unset, the yellow status is triggered immediately when the yellow condition becomes true.



Required? false

Position? named

Default value None

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

VMware.VimAutomation.ViCore.Types.V1.EventType





VMware.VimAutomation.ViCore.Types.V1.Metric







OUTPUTS

VMware.VimAutomation.ViCore.Types.V1.Alarm.AlarmTrigger







NOTES









-------------------------- Example 1 --------------------------



New-AlarmTrigger -EventType $eventType -EntityStatus Red -AlarmDefinition $alarm -EntityType "VirtualMachine"



Adds a new event trigger from the $eventType event type to the existing $alarm alarm with status Red to the

VirtualMachine entity.

-------------------------- Example 2 --------------------------



New-AlarmTrigger -EventType $eventType -EntityStatus Red -EntityType "VirtualMachine"



Creates a new event trigger from the $eventType event type with status Red with the VirtualMachine entity.

-------------------------- Example 3 --------------------------



New-AlarmTrigger -AlarmDefinition $alarm -Metric $metric -MetricAlarmOperator Above -Red 3200 -RedIntervalSeconds

900 -EntityType "VirtualMachine"



Adds a new metric trigger with a $metric metric and an Above operator for the VirtualMachine entity to the $alarm

alarm. The threshold value that triggers a red status is 3200. The time interval for which the red condition must

be true before the red status is triggered is 900.

-------------------------- Example 4 --------------------------



New-AlarmTrigger -Metric $metric -MetricAlarmOperator Above -Red 3200 -RedIntervalSeconds 900 -EntityType

"VirtualMachine"



Creates a new metric trigger with a $metric metric and an Above operator for the VirtualMachine entity. The

threshold value that triggers a red status is 3200. The time interval for which the red condition must be true

before the red status is triggered is 900

-------------------------- Example 5 --------------------------



New-AlarmTrigger -AlarmDefinition $alarm -StatePath "runtime.connectionState" -StateAlarmOperator Equal -Value

"connected" -EntityStatus Red -EntityType "VMHost"



Adds a new state trigger to VMHost with status Red to the $alarm alarm. You can activate the trigger when the

"runtime.connectionState" state is equal to "connected".

-------------------------- Example 6 --------------------------



New-AlarmTrigger -StatePath "runtime.connectionState" -StateAlarmOperator Equal -Value "connected" -EntityStatus

Red -EntityType "VMHost"



Creates a new state trigger to VMHost with status Red. You can activate the trigger when the

"runtime.connectionState" state is equal to "connected".



RELATED LINKS

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