What is this?

This knowledgebase contains questions and answers about PRTG Network Monitor and network monitoring in general.

Learn more

PRTG Network Monitor

Intuitive to Use. Easy to manage.
More than 500,000 users rely on Paessler PRTG every day. Find out how you can reduce cost, increase QoS and ease planning, as well.

Free Download

Top Tags


View all Tags

How to check all currently set Notification Triggers?

Votes:

0

I am using multiple Notification triggers in various places such as groups, equipment, and sensors.

So it is difficult to find out where I set these Notification trigger.

I ask myself where did I set the Notification trigger.

Is there a way to check or export all Notification triggers?

api notification-template notifications trigger

Created on Mar 9, 2021 8:40:45 AM



6 Replies

Votes:

0

Hello Jonathan,

Thank you for your message.

Regarding notification triggers, I'm afraid that there is no native way to get a list of them for all your devices/groups.

However, you have the possibility to use the API of PRTG to get the notification trigger of one object based on its ID, by using the following call:

https://PRTGServer/api/table.json?id=ObjectID&content=triggers&columns=content,objid&username=PRTGUser&passhash=Passhash

The API call above returns a JSON response that you can easily process to create a list. Here are the information returned and their description:

JSON ObjectDescription
typeType of notification trigger used (State trigger, Change trigger, etc.)
latencyTime in seconds before PRTG execute the notification template defined
esclatencyEscalation of the notification (second notification)
repeativalInterval at which PRTG executes a template while the sensor stays in configured state
offnotificationidNotification template executed when sensor is no longer in configured state
escnotificationidNotification template executed for the escalation (while sensor is in configured state)
nodestSensor State configured for which the trigger will execute the notification template(s)
typenameName of the trigger type (similar as type)
onnotificationidNotification template executed when trigger is used (when conditions are fulfilled)

If you have further questions, let us know.

Regards.

Created on Mar 9, 2021 10:29:33 AM by  Florian Lesage [Paessler Support]



Votes:

0

Hi Jonathan,

The native PRTG API does not expose an endpoint for manipulating notification triggers, however you can do this fairly easily using PrtgAPI

Get-Sensor | Get-Trigger

This will return all notification triggers defined on all sensors. Most of these will in fact probably be inherited from their parent object; you can uniquely identify all triggers in your system by grouping according to the ParentId and SubId of the object. Since triggers might also be flagged to not be inherited by child objects, I would say you probably want to inspect all probes, devices, groups and sensors for triggers and then group for each unique one

$objects = Get-Object -Resolve | where { $_ -is "PrtgAPI.SensorOrDeviceOrGroupOrProbe" }
$triggers = $objects | Get-Trigger -Inherited:$false
$unique = $triggers | group { "$($_.parentid)_$($_.subid)" } | foreach { $_.Group | select -first 1 }

This should then give you all the triggers on your system!

C:\> $unique

Type      ObjectId SubId Inherited ParentId Latency Condition Threshold Unit       OnNotificationAction
----      -------- ----- --------- -------- ------- --------- --------- ----       --------------------
State     0        1     False     0        600     Equals    Down                 Ticket Notification
Threshold 2055     4     False     2055     75                7                    Email and push notification to admin
Change    2055     5     False     2055             Change                         Ticket Notification
State     2055     1     False     2055     70      Equals    Down                 Email and push notification to admin
Speed     2055     2     False     2055     80      Below     30        Kbit/Mi... Email and push notification to admin
Volume    2055     3     False     2055             Equals    5                    Email to all members of group PRT...
State     1001     1     False     1001     900     Equals    Down                 Email and push notification to admin
State     1002     1     False     1002     900     Equals    Down                 Email and push notification to admin

For more information on retrieving notification triggers, please see the PrtgAPI wiki

Regards,

lordmilko

Created on Mar 9, 2021 10:42:04 AM



Votes:

0

Hi Lordmilko, I have just installed PRTGAPI, connected to my PRTG server, but it does not output anything on my console when I run 'Get-Sensor | Get-Trigger'. I have tried to output the results to a text file, but no joy. I get results from Get-Probe ok.

I am sure I am doing something wrong, any pointers?

Created on Jun 17, 2021 9:33:01 AM



Votes:

0

Hi Mikeemike,

When you look at one of these sensors in the PRTG UI, do they actually show that the triggers are applying to them? It's possible that the devices or groups in between your probes and sensors have sensor inheritance disabled, hence why your requests to retrieve triggers from sensors are failing

Created on Jun 17, 2021 9:43:03 AM



Votes:

0

Hi Lordmilko,

I am trying to get this to work but my PRTG server seems to be closing the connection when running the get-object cmd.

Any ideas?

Get-Object -Resolve | Where-Object Type -EQ Probe WARNING: 'Get-Object' timed out: The underlying connection was closed: The connection was closed unexpectedly. Retries remaining: 1 Get-Object : The underlying connection was closed: The connection was closed unexpectedly. At line:1 char:12 + $objects = Get-Object -Resolve | Where-Object Type -EQ Probe + ~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [Get-Object], WebException + FullyQualifiedErrorId : System.Net.WebException,PrtgAPI.PowerShell.Cmdlets.GetObject

Created on Aug 3, 2023 12:13:27 PM



Votes:

0

To query probes it makes more sense to simply do "Get-Probe". For any issues relating to PrtgAPI please open a request on GitHub

Created on Aug 7, 2023 7:19:45 AM




Disclaimer: The information in the Paessler Knowledge Base comes without warranty of any kind. Use at your own risk. Before applying any instructions please exercise proper system administrator housekeeping. You must make sure that a proper backup of all your data is available.