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

PRTG Network Monitor

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

Free Download

Top Tags


View all Tags

Using the API, how do I get the trigger notification values of a sensor

Votes:

0

Your Vote:

Up

Down

I can read a sensors last value without any problems, however I need to fetch the value which would trigger a notification. What api call would I make? Please help. Thanks

api notification sensor

Created on Oct 1, 2012 11:23:41 AM by  ianpowell (0) 1



9 Replies

Votes:

0

Your Vote:

Up

Down

Hi,
what precise field do you want to access in the sensor? The limits?
Best regards

Created on Oct 1, 2012 11:58:10 AM by  Konstantin Wolff [Paessler Support]



Votes:

0

Your Vote:

Up

Down

It is a Threshold Trigger "When x channel is Above y for at least 60 seconds perform Email to all members of group xxx"

How can I get this value of this trigger notification?

Created on Oct 1, 2012 12:02:09 PM by  ianpowell (0) 1



Votes:

0

Your Vote:

Up

Down

Hi,
I'm afraid it is not possible to get this value via the PRTG API. Sorry.
Best regards

Created on Oct 1, 2012 12:10:53 PM by  Konstantin Wolff [Paessler Support]



Votes:

0

Your Vote:

Up

Down

This was a question of October 2012. Now it is March 2016. Maybe in the latest version of PRTG possible?

We want to have an overview of sensors that are configured to send a mail and the ones that are nog configured to do so. An we want to kno is a mail is sent, to who.

So I think this should be done using the api to export the next information of each sensor: (inherited of on the object itself) It is a Threshold Trigger "When x channel is Above y for at least 60 seconds perform Email to all members of group xxx"

is this possible to use api/getobjectproperty.htm?id=<sensorid>&name=<?>

what would be used as name here?

Created on Mar 17, 2016 1:04:36 PM by  ACDuindam (0) 1



Votes:

0

Your Vote:

Up

Down

Hi,
still not possible. Sorry.
Best regards

Created on Mar 18, 2016 2:11:20 PM by  Konstantin Wolff [Paessler Support]



Votes:

0

Your Vote:

Up

Down

Using the ChannelLimits tool from http://prtgtoolsfamily.com/downloads/tools you can get an overview on how your channel limits are set.

Created on Mar 18, 2016 3:19:51 PM by  PRTG Tools Family [prtgtoolsfamily.com] (13,183) 3 4



Votes:

0

Your Vote:

Up

Down

My Powershell module will let you access the limits and thresholds of any sensor / channel combo.

Read more about it here: https://thedomainiown.wordpress.com/prtg-related/prtg-script-powershell-admin-module/

Change log last week was:

2016/3/15

  • Added Get-PRTGSensorData, for getting historical data.
  • Added Get-PRTGChannelSettings for getting settings like channel thresholds / limits
  • Added Set-PRTGChannelSettings for setting settings like channel thresholds / limits
  • Added Get-PRTGSensorChannelPrediction used for estimating when a sensor will reach a certain limit. For example, days until disk is full.

The functions are rather new, and not part of the official PRTG API, so be warned that it might stop working at any time. I also don't have an example that uses the Get-PRTGChannelSettings function yet.

A full list of function is here: https://thedomainiown.wordpress.com/prtg-related/prtg-relatedprtg-admin-module-function-list/

Created on Mar 20, 2016 12:38:42 AM by  AndrewG (1,783) 2 2



Votes:

7

Your Vote:

Up

Down

WARNING: THIS IS NOT USING THE API AND MAY CHANGE AT ANY TIME
Edit by Paessler Support: This script comes without any support.

#This is powershell
$DeviceID = 2034
$ChannelID = 2
$auth = "username=api_access&passhash=1234567890"
$PRTGHost = "192.168.0.89"

$url = "http://$PRTGHost/controls/channeledit.htm?_hjax=true&id=$DeviceID&channel=$ChannelID&$auth"
    
$request = Invoke-WebRequest -Uri $url -MaximumRedirection 0 -ErrorAction Ignore
$ret = $request.AllElements | select name,value | where {$_.name -like "*_*"}
foreach ($line in $ret)
{
  $line.name = $line.name -replace "_$ChannelID",""
}
$ret

This returns the following:

name                   value
----                   -----
customunit             Days 
factorm                1    
factord                1    
valuelookup                 
showchart              1    
showchart              0    
show                   1    
show                   0    
colmode                0    
colmode                1    
color                       
linewidth              1    
percent                0    
percent                1    
ref100percent               
ref100percent_factor   1    
avgmode                0    
avgmode                1    
avgmode                2    
decimalmode            0    
decimalmode            1    
decimalmode            2    
decimaldigits          2    
spikemode              0    
spikemode              1    
spikemax                    
spikemax_factor        1    
spikemin                    
spikemin_factor        1    
axismode               0    
axismode               1    
axismax                     
axismax_factor         1    
axismin                     
axismin_factor         1    
limitmode              0    
limitmode              1    
limitmaxerror               
limitmaxerror_factor   1    
limitmaxwarning             
limitmaxwarning_factor 1    
limitminwarning             
limitminwarning_factor 1    
limitminerror               
limitminerror_factor   1    
limiterrormsg               
limitwarningmsg             

Tested with version 16.1.22.2391

Created on Mar 22, 2016 9:48:27 PM by  AndrewG (1,783) 2 2

Last change on Mar 23, 2016 6:24:34 AM by  Felix Saure [Paessler Support]



Votes:

0

Your Vote:

Up

Down

You can retrieve the properties of a notification trigger (including the thresholds at which the trigger activates as well as the name of the Notification Action that will be triggered) via the Get-NotificationTrigger cmdlet of PrtgAPI

C:\> Get-Sensor -Id 1001 | Get-NotificationTrigger

Type      ObjectId SubId Inherited ParentId Latency Condition Threshold Unit       OnNotificationAction
----      -------- ----- --------- -------- ------- --------- --------- ----       --------------------
State     1        1     True      0        600     Equals    Down                 Ticket Notification

The Get-NotificationTrigger cmdlet will list all triggers defined on an object, both inherited as well as explicitly defined. You can see all the properties you can interface with by piping to Format-List.

Created on Feb 20, 2018 1:31:55 AM by  lordmilko (2,002) 2 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.