< Back

Add-NotificationTrigger

Sun Jan 19, 2020 5:39 pm

NAME Add-NotificationTrigger



SYNOPSIS

Adds a notification trigger to a PRTG Server.





SYNTAX

Add-NotificationTrigger [-Type] {State | Speed | Volume | Threshold | Change} -Object

<SensorOrDeviceOrGroupOrProbe> [-Channel <object>] [-Condition {Above | Below | Equals | NotEquals | Change}]

[-EscalationLatency <int>] [-EscalationNotificationAction <NameOrObject`1>] [-Latency <int>]

[-OffNotificationAction <NameOrObject`1>] [-OnNotificationAction <NameOrObject`1>] [-Period {Hour | Day | Week |

Month}] [-RepeatInterval <int>] [-Resolve <SwitchParameter>] [-State {Down | Warning | Unusual | DownPartial | Up

| Unknown}] [-Threshold <double>] [-UnitSize {Bit | Kbit | Mbit | Gbit | Tbit | Byte | KByte | MByte | GByte |

TByte}] [-UnitTime {Second | Minute | Hour | Day}] [<CommonParameters>]



Add-NotificationTrigger [-Parameters] <TriggerParameters> [-Resolve <SwitchParameter>] [<CommonParameters>]





DESCRIPTION

The Add-NotificationTrigger/New-NotificationTrigger cmdlet adds a new notification trigger to an object in PRTG.

When adding a notification trigger, you can either specify the settings for the trigger as parameters to the

cmdlet (PowerShell style), or must first create a TriggerParameters object that defines the settings to use

(object-oriented style). TriggerParameters can be defined from existing notification triggers or created from

scratch. Certain objects do support certain types of notification triggers (e.g. different types of sensors).



Attempting to add a notification trigger to an object that does not supported that trigger type will generate an

InvalidTriggerTypeException. Notification triggers applied to parent objects that are not supported by their

children are simply ignored within PRTG, and do not generate exceptions. For information on viewing the trigger

types supported by an object, see Get-NotificationTrigger -Types



By default, Add-NotificationTrigger will attempt to resolve the created trigger to a NotificationTrigger object.

As PRTG does not return the ID of the created object, PrtgAPI identifies the newly created trigger by comparing

the triggers on the parent object before and after the new trigger is created. While this is generally very

reliable, in the event something or someone else creates another new trigger directly under the target object with

the same OnNotificationAction, that object will also be returned in the objects resolved by

Add-NotificationTrigger. If you do not wish to resolve the created trigger, this behavior can be disabled by

specifying -Resolve:$false.



For more information on creating TriggerParameters , see New-NotificationTriggerParameters.





PARAMETERS

-Object <SensorOrDeviceOrGroupOrProbe>

The object to create a notification trigger under.



Required? true

Position? named

Default value

Accept pipeline input? true (ByValue)

Accept wildcard characters? false



-Type <TriggerType>

The type of notification trigger to create.



Possible values: State, Speed, Volume, Threshold, Change



Required? true

Position? 0

Default value State

Accept pipeline input? false

Accept wildcard characters? false



-Parameters <TriggerParameters>

The parameters to use to add a NotificationTrigger.



Required? true

Position? 0

Default value

Accept pipeline input? true (ByValue)

Accept wildcard characters? false



-Resolve <SwitchParameter>

Indicates whether or not the new object should be resolved to a PrtgObject. By default this value is Present.



Required? false

Position? named

Default value True

Accept pipeline input? false

Accept wildcard characters? false



-State <TriggerSensorState>

Possible values: Down, Warning, Unusual, DownPartial, Up, Unknown



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Latency <int>



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-OnNotificationAction <NameOrObject`1>



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-OffNotificationAction <NameOrObject`1>



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-EscalationNotificationAction <NameOrObject`1>



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-EscalationLatency <int>



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-RepeatInterval <int>



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Channel <object>



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Period <TriggerPeriod>

Possible values: Hour, Day, Week, Month



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-UnitSize <DataUnit>

Possible values: Bit, Kbit, Mbit, Gbit, Tbit, Byte, KByte, MByte, GByte, TByte



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Condition <TriggerCondition>

Possible values: Above, Below, Equals, NotEquals, Change



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Threshold <double>



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-UnitTime <TimeUnit>

Possible values: Second, Minute, Hour, Day



Required? false

Position? named

Default value

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

PrtgAPI.SensorOrDeviceOrGroupOrProbe

The object to create a notification trigger under.



PrtgAPI.Parameters.TriggerParameters

The parameters to use to add a NotificationTrigger.





OUTPUTS



---------- EXAMPLE 1 ----------



C:\\ Get-Probe -Id 1001 | New-Trigger -Type State -OnNotificationAction *ticket* -Latency 40



Create a new state trigger on the probe with ID 1001 that activates the "Ticket Notification" action 40 seconds

after being triggered.



---------- EXAMPLE 2 ----------



C:\\> Get-Probe | Get-NotificationTrigger | New-TriggerParameters 2001 | Add-Trigger



Add all triggers on all probes directly to the object with ID 2001.



RELATED LINKS

Online version: https://github.com/lordmilko/PrtgAPI/wi ... gers#add-1

New-NotificationTriggerParameters

Set-NotificationTrigger

Set-NotificationTriggerProperty