New Question
 
 
PRTG Network Monitor

Intuitive to Use.
Easy to manage.

200.000 administrators have chosen PRTG to monitor their network. Find out how you can reduce cost, increase QoS and ease planning, as well.

Free PRTG
Download >>

 

What is this?

This knowledgebase contains questions and answers about PRTG Network Monitor and network monitoring in general. You are invited to get involved by asking and answering questions!

Learn more

 

Top Tags


View all Tags


Auditing alerting thresholds, notifications and limits via API

Votes:

0

Your Vote:

Up

Down

Hi guys, i was wondering if you had any pointers on how to collect the alerting/notification settings for every sensor on our prtg server so we can audit them and make sure they are standardised.

Im looking for

  • Limits Enabled - y/n
  • Thresholds for sensors Alarm and Warn
  • If possible what notification triggers exist for a device I.e just a ticket or email groups.

However i need this on a large scale for everything. Any API pointers greatly received, i also use LordMilkos API suite if he is about :)

api limits lordmilko notifications threshold

Created on May 10, 2018 11:02:15 AM by  Samuel Ashdown (60) 1 1

Last change on May 10, 2018 11:38:38 AM by  Luciano Lingnau [Paessler Support]



4 Replies

Accepted Answer

Votes:

2

Your Vote:

Up

Down

Hi Samuel,

This can be achieved with the Get-Channel and Get-NotificationTrigger cmdlets of PrtgAPI. For more information, see Channels and Notification Triggers on the PrtgAPI wiki

C:\> Get-Sensor | Select -First 1 | Get-Channel

Name                SensorId    Id    LastValue LimitsEnabled UpperErrorLimit LowerErrorLimit ErrorLimitMessage
----                --------    --    --------- ------------- --------------- --------------- -----------------
Total               3001         0       0.32 %          True              95                 PANIC!! PANIC!!!
Processor 1         3001         1         <1 %         False
C:\> Get-Probe | Get-NotificationTrigger

Type        ObjectId SubId Inherited ParentId Latency Condition Threshold Units      OnNotificationAction
----        -------- ----- --------- -------- ------- --------- --------- -----      --------------------
Change      1        8     False     1                Change                         Ticket Notification
State       1        1     True      0        600     Equals    Down                 Email Administrator
Threshold   1        7     False     1        60      NotEquals 5                    Email PRTG Alerts Mailbox
Speed       1        5     False     1        60      Above     3         TByte/Day  SMS Escalation Team 1
Volume      1        6     False     1                Equals    6         KByte/Hour SMS Escalation Team 1

Regards,

lordmilko

Created on May 10, 2018 12:01:49 PM by  lordmilko (1,432) 2 1



Votes:

0

Your Vote:

Up

Down

Hey there LordMilko! I actually figured this out from the docs of prtgapi about 15s after i posted it but then the edit feature wouldnt work. Do you by any chance know how to include device/sensor name in the get-notificationtrigger output? I'm happy working with objids but this spreadsheet is going to head honchos who need names, numbers and charts :)

Created on May 10, 2018 12:06:26 PM by  Samuel Ashdown (60) 1 1



Votes:

2

Your Vote:

Up

Down

Hi Sam,

The API calls made by Get-NotificationTrigger do not return that information, however this can be achieved very easily with a bit of PowerShell magic

C:\> $triggers = Get-Probe | foreach { $_ | Get-Trigger | Add-Member Name $_.Name -PassThru }
C:\> $triggers | fl

Name                         : Local Probe
ObjectId                     : 1
ParentId                     : 0
Inherited                    : True
Type                         : State
TypeName                     : State Trigger
SubId                        : 1
Latency                      : 600
Channel                      :
Unit                         :
OnNotificationAction         : Ticket Notification
OffNotificationAction        : None
Threshold                    : Down
Condition                    : Equals
EscalationLatency            : 900
EscalationNotificationAction : Ticket Notification
RepeatInterval               : 0

Instead of piping Get-Probe straight into Get-Trigger, we pipe it into a foreach cmdlet that performs three functions

1. Retrieves all triggers from the input Probe

2. Adds a new property "Name" to each trigger containing the name of the input Probe

3. Writes the updated input Probe to the pipeline

You will also find an example showing this exact technique on the Channels page of the wiki, showing how the name of each Sensor can be added to each channel

Regards,

lordmilko

Created on May 10, 2018 12:16:19 PM by  lordmilko (1,432) 2 1



Votes:

0

Your Vote:

Up

Down

holy frijoles... you're a savior ma dude :)

Created on May 10, 2018 12:30:55 PM by  Samuel Ashdown (60) 1 1



Please log in or register to enter your reply.


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.