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.
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 server stored procedure multi channel

Votes:

0

Your Vote:

Up

Down

I want the output of my SQL Stored Procedure to show multi channels in one sensor, instead of having a single sensor for every value that I want to monitor.

How can I do this?

custom-script-exe custom-sensor multichannel sql

Created on Feb 3, 2011 2:49:47 PM by  PRTG Tools Family [prtgtoolsfamily.com] (13,273) 3 4

Last change on Mar 20, 2015 1:26:23 PM by  Martina Wittmann [Paessler Support]



1 Reply

Accepted Answer

Votes:

0

Your Vote:

Up

Down

PTF.SQLspXML

This can done with Custom Sensor PTF.SQLspXML

The sensor parses the multi channel results of a SQL query to PRTG.

Parameters:

-d=database -sp=StoredProcedure [-s=SQLserver] [-u=username] [-p=password|passhash]
 
-d=    Database name on the SQL server.
-sp=   Name of the Stored Procedure to execute.
-s=    Optional, IP or DNS name of the SQL server.
       If ommitted the hostname of the parent device is used
-u=    Optional, UserName of the SQL account.
       If ommitted the credentials entered at the parent device are used.
-p=    Optional, Password or PassHash * of the SQL account.
       If ommitted the credentials entered at the parent device are used

The Stored Procedure has to return columns with a fixed name:

CREATE PROCEDURE [dbo].[spSQL2XML]
AS
BEGIN
	DECLARE @tblPRTG	TABLE
		(
		  Channel	nvarchar(50)
		, Value		nvarchar(50)
		, IsInt		bit
		, Unit		nvarchar(50)
		);
		
	INSERT INTO @tblPRTG VALUES ('Channel #1','1.00',0,'Euro')
	INSERT INTO @tblPRTG VALUES ('Channel #2','2.00',0,'Dollar')
	
	SELECT * FROM @tblPRTG
END

Note: this sensor is of the EXEXML type and requires PRTG version 8.2.0.1863 or later.

Created on Feb 3, 2011 3:04:49 PM by  PRTG Tools Family [prtgtoolsfamily.com] (13,273) 3 4

Last change on Apr 25, 2013 8:02:53 AM by  PRTG Tools Family [prtgtoolsfamily.com] (13,273) 3 4



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.