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

Alert on value change

Votes:

0

I have a MYSQL sensor and I want to generate an alert if the return value changed from it's previous value.

Say the interval is 5 minutes and the value is 3. If the value changes to 2 or 4, I want the sensor to go into alarm. It would stay in alarm until it scans again and there is not change from the previous value.

Thanks

alert change notifications prtg value wishlist

Created on Mar 11, 2010 5:59:50 PM

Last change on Mar 15, 2010 11:31:15 AM by  Daniel Zobel [Product Manager]



Best Answer

Accepted Answer

Votes:

2

Use a dummy table

Create a dummy table in your database to hold the last value from your original query. If the last value differs from the stored value return 1, else return 0.

Your sensor could then generate an alarm if the return value = 1

If your original query was:

SELECT count(*) FROM tblNAW

You could change this into:

DECLARE @result     INT
DECLARE @LASTresult INT

SET @result = (SELECT count(*) FROM tblNAW)
SET @LASTresult = (SELECT TOP 1 LASTresult FROM tblDUMMY)

UPDATE tblDUMMY SET LASTresult = @result

IF @result = @LASTresult
  SELECT 0
ELSE
  SELECT 1

Created on Mar 12, 2010 2:49:11 PM



6 Replies

Votes:

0

In the sensor's Channels tab you can enable limits and set an upper error and lower error limit, but those are not dynamic.

Created on Mar 12, 2010 8:51:22 AM by  Aurelio Lombardi [Paessler Support]

Last change on Mar 12, 2010 9:21:51 AM by  Daniel Zobel [Product Manager]



Votes:

0

So there is no way, sensor factory, etc to setup a sensor to alarm if the value is different that what it last was?

Could you setup two sensors with different scanning intervals and use sensor factory to compare?

Created on Mar 12, 2010 1:32:15 PM



Votes:

0

no, sorry.

Created on Mar 12, 2010 2:07:03 PM by  Aurelio Lombardi [Paessler Support]



Accepted Answer

Votes:

2

Use a dummy table

Create a dummy table in your database to hold the last value from your original query. If the last value differs from the stored value return 1, else return 0.

Your sensor could then generate an alarm if the return value = 1

If your original query was:

SELECT count(*) FROM tblNAW

You could change this into:

DECLARE @result     INT
DECLARE @LASTresult INT

SET @result = (SELECT count(*) FROM tblNAW)
SET @LASTresult = (SELECT TOP 1 LASTresult FROM tblDUMMY)

UPDATE tblDUMMY SET LASTresult = @result

IF @result = @LASTresult
  SELECT 0
ELSE
  SELECT 1

Created on Mar 12, 2010 2:49:11 PM



Votes:

0

Can I request that this type of trigger be added to the next version?

Thanks

Created on Mar 12, 2010 3:07:15 PM



Votes:

0

Hi, you could declare the value as "delta" instead of "integer" and the set the upper errorlevel to 1 and the lower alarmlevel to -1. That works great for snmp-custom sensors. I'm not sure, if that is possible in the GUI for Database-sensors, but should work in device-templates XML.

Created on Oct 7, 2022 2:58:00 PM




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.