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

How to prevent empty resultset errors

Votes:

0

Your Vote:

Up

Down

I had the problem with SQL sensors, that in case no result is found for the defined condition an error appeared.

In my case it is not wrong to have no recordset returned.

The solultion I figured out now is like this:

SELECT Sum = 
CASE 
  WHEN SUM(PAGECOUNT) IS NULL THEN 0 
  ELSE SUM(PAGECOUNT) 
END
FROM <Table> WHERE <condition>

This prevent the downtime error for empty resultset.

Is it the intended way for PRTG? Any other / easier solutions possible?

prtg recordset result sql

Created on May 26, 2010 9:02:34 AM by  Jo (0) 1

Last change on May 27, 2010 6:24:11 AM by  Daniel Zobel [Product Manager]



3 Replies

Accepted Answer

Votes:

0

Your Vote:

Up

Down

If you select the result Result Set []is returned option the query always has to return a result set, otherwise the sensor will go into an error state. Your approach avoids the missing result set so it is a practicable method. I'm afraid there isn't an "easier" solution unless you turn off the result set option, in which case a result set is not mandatory.

Created on May 26, 2010 9:47:19 AM by  Patrick Hutter [Paessler Support] (7,225) 3 3



Votes:

0

Your Vote:

Up

Down

In case I disable the result set option, the return value is not monitored, right? At least on my V7.3.4.5710 it behaves like this.

But this is mandatory for me to configure e.g. max. limits and to see the progress over the production day.

Created on May 26, 2010 9:59:56 AM by  Jo (0) 1



Votes:

0

Your Vote:

Up

Down

That is correct. As such, your current solution is the best practice to date.

Created on May 26, 2010 10:38:13 AM by  Patrick Hutter [Paessler Support] (7,225) 3 3



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.