New-AlarmDefinition Command | Vmware PowerCLI Reference

New-AlarmDefinition

This cmdlet creates a new alarm definition.

Syntax

New-AlarmDefinition
-AlarmTrigger < AlarmTrigger[] >
-Entity < VIObject >
-Name < String >
[-ActionRepeatMinutes < Int32 > ]
[-AlarmAction < AlarmAction[] > ]
[-Description < String > ]
[-Disabled ]
[-ProgressAction < ActionPreference > ]
[-ReportingFrequencyMinutes < Int32 > ]
[-ReportingTolerancePercentage < Int32 > ]
[CommonParameters]

Parameters

Required Parameter Name Type Position Features Description
required
AlarmTrigger AlarmTrigger[] named
Specifies the alarm triggers which you can use to activate the alarm.
required
Entity VIObject named
Specifies the entity to which you want to attach the alarm. If you want to specify the root, use the data centers.
required
Name String named
Specifies the alarm name.
optional ActionRepeatMinutes Int32 named
Specifies the frequency in minutes. This indicates how often appropriate actions should be repeated when an alarm does not change its state.
optional AlarmAction AlarmAction[] named
Specifies the alarm actions which you want to be executed when the alarm triggers.
optional Description String named
Specifies the alarm description.
optional Disabled SwitchParameter named
Specifies if the alarm is deactivated. By default, the alarm is activated.
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.

Output

VMware.VimAutomation.ViCore.Types.V1.Alarm.AlarmDefinition

Examples

Example 1

New-AlarmDefinition -Name "AlarmName" -AlarmTrigger $alarmTriggers -Entity $entity

Creates an enabled alarm definition with the "AlarmName" name and a collection of $alarmTriggers triggers for the $entity.

Example 2

New-AlarmDefinition -Name "AlarmName" - AlarmTrigger $alarmTriggers -AlarmAction $alarmAction -Entity $entity -Description "alarm definition description" -ActionRepeatMinutes 20 -ReportingFrequencyMinutes 30 -ReportingTolerancePercentage 10 -Disabled

Creates a deactivated alarm definition with the "AlarmName" name, an "alarm definition description" description, and a collection of $alarmTriggers triggers for the $entity. The newly created alarm definition has alarm actions: $alarm Action. The alarm action repeat minutes are 20, the reporting frequency minutes are 30, and the reporting tolerance range is 10.

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)