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

Notification when value does not change

Votes:

0

Hi,

I've a custom script sensor that fetch a variable numeric value provided every 5min by a third part system. If this system "hang" the numeric value will remain constant for a long time.

Is there a way to setup the PRTG sensor to "detect" that the value has not changed in the last n monitoring cycles and throw an alert? The "unusual" state seems not an option so I wonder if this can be achieved in a different way...

exe-script-sensor prtg unusual

Created on May 13, 2021 8:38:23 AM

Last change on May 13, 2021 11:29:58 AM by  Florian Lesage [Paessler Support]



1 Reply

Votes:

0

Hello Gianluca,

Thank you for your message.

I'm afraid that there is no native option to trigger a notification when the value is the same for x scanning interval.

In this case, you could create a threshold trigger such as the one below and automatically replace the value with the one returned by the sensor (with a script). To do so, you can use the PowerShell module PRTGAPI whose GitHub page and documentation are here: https://github.com/lordmilko/PrtgAPI
https://github.com/lordmilko/PrtgAPI/wiki

Here is the cmdlet you can use to modify the threshold:

# Get the trigger based on its subID
$trigger = Get-Sensor -id SensorID | Get-Trigger -Inherited $false -SubId TriggerSubID

# Change the threshold to the value of the sensor
$trigger | Set-TriggerProperty Threshold Value -Verbose

To get the subID of the trigger, you can use the command below:

Get-Sensor -Id SensorID | Get-Trigger -Inherited $false -Type Threshold

You will find all the information on how to get and modify a notification trigger with PRTGAPI here: https://github.com/lordmilko/PrtgAPI/wiki/Notification-Triggers

Regarding the sensor value, you can use the API of PRTG to get it:

/api/table.json?content=channels&output=json&columns=name,lastvalue_&id=SensorID&usecaption=true&username=PRTGUser&passhash=Passhash

However, please notice that we do not provide support for it as it relies on HTTP request (not the API of PRTG).

If you have questions, let us know.

Regards.

Created on May 13, 2021 11:55:27 AM by  Florian Lesage [Paessler Support]

Last change on May 13, 2021 11:55:41 AM by  Florian Lesage [Paessler Support]




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.