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

MONITOR SQL LOG SPACE

Votes:

0

Hello,

I would like to monitor one Database SpaceLog with PRTG.

When I query this SQLPERF : "DBCC SQLPERF(logspace)" on my database I have row/culumn fullfil with log space and log size.

So I try to add some elements to this SQL Script to adapt it for PRTG

declare @LogSpace table
(
DatabaseName varchar(255),
[LOG_SIZE] decimal,
[LOG_SPACE] decimal,
[Status] int)

insert into @LogSpace
execute('dbcc sqlperf(''LogSpace'')')

select * from @LogSpace
WHERE DatabaseName = 'MY_DATABASE'

When I put query this I get something interesting. It works like charm. To configure the sensor I follow this KB: https://kb.paessler.com/en/topic/18183-how-do-i-monitor-the-size-of-a-microsoft-sql-server-database

I create Microsoft SQL v2 sensor, I choose the SQL script (show just before) and I put Data Processing option, Absolute, Culumn name, BytesDisk, etc.

PRTG sensor return this : "No valid datatable was returned"

I don't know what am I doing wrong.

Thank you for your help,

Best Regards.

microsoft prtg spacelog sql

Created on Jun 23, 2017 2:34:08 PM

Last change on Jun 26, 2017 8:29:23 PM by  Stephan Linke [Paessler Support]



1 Reply

Votes:

0

Hi,

You need to use temporary tables, declare statements won't work in that case. The following should be helpful: https://www.simple-talk.com/sql/t-sql-programming/temporary-tables-in-sql-server/


Kind regards,
Stephan Linke, Tech Support Team

Created on Jun 26, 2017 8:32:04 PM by  Stephan Linke [Paessler Support]

Last change on Jun 26, 2017 8:32:17 PM by  Stephan Linke [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.