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

SQL Sensor v2 not working

Votes:

0

I'm in the process of setting up the SQL Sensor v2. However when the sensor is executed it returns with and error - "No valid datatable was returned".

If the SQL query used in the sensor is executed in SQL Managment studio it does return one row with a value.

The result set is as follows:

(No column name)	run_status
CopyBatchData	        1

ms-sql sql-v2 sqlsensor

Created on Aug 22, 2016 10:43:56 AM

Last change on Aug 22, 2016 1:12:31 PM by  Arne Seifert [Paessler Support]



3 Replies

Votes:

0

Dear SQLHead

The error message implies that no table, or a completely empty table (with zero rows) was returned. Please check if you perform the SQL query on the correct database.

The SQL v2 sensor can also be started outside of PRTG. In the PRTG installation folder, subfolder "Sensor System", you find the file "SQLv2.exe". You can use this file to test the database connection and result for different queries.

Created on Aug 22, 2016 1:18:03 PM by  Arne Seifert [Paessler Support]



Votes:

0

Hi

Thank you for the response, I've got the SQL Query to work.

After correcting the query I'm experiencing the following error though.

"Invalid column name 'run_status'.

If you run it in the SQL v2 sensor outside PRTG it is working but within I get this error.

Herewith is my query for your assistance:

select 'CopyBatchData', case when run_status = '0' then '0' else '1' end as [status] from msdb.dbo.sysjobhistory where job_id = 'B2B95BEF-BBCC-4A18-A90D-947E7626AEE7' and run_date >= cast(convert(varchar(8), getdate (),112) as int) and run_time > cast ((REPLACE(CONVERT(VARCHAR(5), GETDATE(), 108), ':', '') - 100) * 100 as int) and step_id = '1'

Regards,

Created on Aug 23, 2016 6:28:29 AM



Votes:

0

Dear SQLHead

This case should be continued as a support case. Please contat [email protected]. Please describe the case in that email. In your sensor settings, please enable the "Write result to disk" option in the sensor and attach the two according log files, which are usually located in "C:\ProgramData\Paessler\PRTG Network Monitor\Logs (Sensors)" to that email.

Please also include screenshots of

  • the sensor overview tab
  • the sensor settings tab (multiple screenshots if required to cover all settings.)

Created on Aug 23, 2016 6:17:28 PM by  Arne Seifert [Paessler Support]

Last change on Aug 23, 2016 6:18:21 PM by  Arne Seifert [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.