New-AlarmTrigger Command | Vmware PowerCLI Reference

New-AlarmTrigger

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.

Syntax

New-AlarmTrigger
-AlarmDefinition < AlarmDefinition[] >
-EntityType < String >
-EventType < EventType >
[-Argument < AlarmTriggerArgument[] > ]
[-EntityStatus < EntityStatus > ]
[-ProgressAction < ActionPreference > ]
[-Server < VIServer[] > ]
[CommonParameters]

Parameters

Required Parameter Name Type Position Features Description
required
AlarmDefinition AlarmDefinition[] named
  • pipeline
Specifies the existing alarm to which you want to add the trigger.
required
EntityType String named
Specifies the type of object on which the event occurs, its containing state or metric. ?he valid PowerCLI type names are Cluster, Datacenter, Datastore, DistributedSwitch, VMHost, VirtualPortGroup, ResourcePool, VirtualMachine, and so on.
required
EventType EventType named
  • pipeline
Specifies the event to trigger. You can find the event types by using the Get-EventType cmdlet.
optional Argument AlarmTriggerArgument[] named
Specifies the arguments on which the event occurs, including condition comparisons. ?he valid values are fetched by New-AlarmTriggerArgument.
optional EntityStatus EntityStatus named
Specifies the trigger status. The allowed values for the Metric and State triggers are Red and Yellow.
optional ProgressAction ActionPreference named
optional Server VIServer[] named
  • wildcards
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.
New-AlarmTrigger
-AlarmDefinition < AlarmDefinition[] >
-EntityType < String >
-Metric < Metric >
-MetricAlarmOperator < MetricAlarmOperator >
[-ProgressAction < ActionPreference > ]
[-Red < Int32 > ]
[-RedIntervalSeconds < Int32 > ]
[-Server < VIServer[] > ]
[-Yellow < Int32 > ]
[-YellowIntervalSeconds < Int32 > ]
[CommonParameters]

Parameters

Required Parameter Name Type Position Features Description
required
AlarmDefinition AlarmDefinition[] named
  • pipeline
Specifies the existing alarm to which you want to add the trigger.
required
EntityType String named
Specifies the type of object on which the event occurs, its containing state or metric. ?he valid PowerCLI type names are Cluster, Datacenter, Datastore, DistributedSwitch, VMHost, VirtualPortGroup, ResourcePool, VirtualMachine, and so on.
required
Metric Metric named
  • pipeline
Specifies the metric to trigger on. You can find the metrics by using the Get-Metric cmdlet.
required
MetricAlarmOperator MetricAlarmOperator named
Specifies the operation of the target metric.
optional ProgressAction ActionPreference named
optional Red Int32 named
Specifies the threshold value that triggers a red status.
optional RedIntervalSeconds Int32 named
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.
optional Server VIServer[] named
  • wildcards
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.
optional Yellow Int32 named
Specifies the threshold value that triggers a yellow status.
optional YellowIntervalSeconds Int32 named
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.
New-AlarmTrigger
-AlarmDefinition < AlarmDefinition[] >
-EntityType < String >
-StateAlarmOperator < StateAlarmOperator >
-StatePath < String >
-Value < String >
[-EntityStatus < EntityStatus > ]
[-ProgressAction < ActionPreference > ]
[-Server < VIServer[] > ]
[CommonParameters]

Parameters

Required Parameter Name Type Position Features Description
required
AlarmDefinition AlarmDefinition[] named
  • pipeline
Specifies the existing alarm to which you want to add the trigger.
required
EntityType String named
Specifies the type of object on which the event occurs, its containing state or metric. ?he valid PowerCLI type names are Cluster, Datacenter, Datastore, DistributedSwitch, VMHost, VirtualPortGroup, ResourcePool, VirtualMachine, and so on.
required
StateAlarmOperator StateAlarmOperator named
Specifies the operation of the target state.
required
StatePath String named
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
Value String named
Specifies the condition of the state path.
optional EntityStatus EntityStatus named
Specifies the trigger status. The allowed values for the Metric and State triggers are Red and Yellow.
optional ProgressAction ActionPreference named
optional Server VIServer[] named
  • wildcards
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.
New-AlarmTrigger
-EntityType < String >
-EventType < EventType >
[-Argument < AlarmTriggerArgument[] > ]
[-EntityStatus < EntityStatus > ]
[-ProgressAction < ActionPreference > ]
[-Server < VIServer[] > ]
[CommonParameters]

Parameters

Required Parameter Name Type Position Features Description
required
EntityType String named
Specifies the type of object on which the event occurs, its containing state or metric. ?he valid PowerCLI type names are Cluster, Datacenter, Datastore, DistributedSwitch, VMHost, VirtualPortGroup, ResourcePool, VirtualMachine, and so on.
required
EventType EventType named
  • pipeline
Specifies the event to trigger. You can find the event types by using the Get-EventType cmdlet.
optional Argument AlarmTriggerArgument[] named
Specifies the arguments on which the event occurs, including condition comparisons. ?he valid values are fetched by New-AlarmTriggerArgument.
optional EntityStatus EntityStatus named
Specifies the trigger status. The allowed values for the Metric and State triggers are Red and Yellow.
optional ProgressAction ActionPreference named
optional Server VIServer[] named
  • wildcards
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.
New-AlarmTrigger
-EntityType < String >
-Metric < Metric >
-MetricAlarmOperator < MetricAlarmOperator >
[-ProgressAction < ActionPreference > ]
[-Red < Int32 > ]
[-RedIntervalSeconds < Int32 > ]
[-Server < VIServer[] > ]
[-Yellow < Int32 > ]
[-YellowIntervalSeconds < Int32 > ]
[CommonParameters]

Parameters

Required Parameter Name Type Position Features Description
required
EntityType String named
Specifies the type of object on which the event occurs, its containing state or metric. ?he valid PowerCLI type names are Cluster, Datacenter, Datastore, DistributedSwitch, VMHost, VirtualPortGroup, ResourcePool, VirtualMachine, and so on.
required
Metric Metric named
  • pipeline
Specifies the metric to trigger on. You can find the metrics by using the Get-Metric cmdlet.
required
MetricAlarmOperator MetricAlarmOperator named
Specifies the operation of the target metric.
optional ProgressAction ActionPreference named
optional Red Int32 named
Specifies the threshold value that triggers a red status.
optional RedIntervalSeconds Int32 named
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.
optional Server VIServer[] named
  • wildcards
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.
optional Yellow Int32 named
Specifies the threshold value that triggers a yellow status.
optional YellowIntervalSeconds Int32 named
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.
New-AlarmTrigger
-EntityType < String >
-StateAlarmOperator < StateAlarmOperator >
-StatePath < String >
-Value < String >
[-EntityStatus < EntityStatus > ]
[-ProgressAction < ActionPreference > ]
[-Server < VIServer[] > ]
[CommonParameters]

Parameters

Required Parameter Name Type Position Features Description
required
EntityType String named
Specifies the type of object on which the event occurs, its containing state or metric. ?he valid PowerCLI type names are Cluster, Datacenter, Datastore, DistributedSwitch, VMHost, VirtualPortGroup, ResourcePool, VirtualMachine, and so on.
required
StateAlarmOperator StateAlarmOperator named
Specifies the operation of the target state.
required
StatePath String named
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
Value String named
Specifies the condition of the state path.
optional EntityStatus EntityStatus named
Specifies the trigger status. The allowed values for the Metric and State triggers are Red and Yellow.
optional ProgressAction ActionPreference named
optional Server VIServer[] named
  • wildcards
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.AlarmTrigger

Examples

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".

Example 7

$argument = New-AlarmTriggerArgument

cmdlet New-AlarmTriggerArgument at command pipeline position 1
Supply values for the following parameters:
AttributeName: Cluster Name
Operator: equals
Value: vSAN-ESA-Cluster

New-AlarmTrigger -AlarmDefinition $alarm -EntityType "VMHost" -EventType $event -Argument $argument

Creates a new event trigger to a VMHost with the specified arguments and the $alarm alarm definition. The Cluster Name attribute must be equal to "vSAN-ESA-Cluster".

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)