I finally got it to work :)
For people wanting to create the same functionality of a simple return value out of a Stored Procedure i created the steps in a logical order, providing them an easier way to get stuff working :
Make sure your SP returns a 0 or 1 by filling a variable with a 0 for OK or a 1 for Error, using Select @NameOfVariable as the last command before end in your SP
Create an SQL query file :
C:\Program Files (x86)\PRTG Network Monitor\Custom Sensors\sql\mssql\<NameOfSqlSensorFile.sql> |
in the file include a single line :
exec <nameofStoredProcedure>
Create an lookup file on the PRTG host :
C:\Program Files (x86)\PRTG Network Monitor\lookups\custom\prtg.yes0no1.ovl |
containing :
-------------------------
<?xml version="1.0" encoding="UTF-8"?>
<ValueLookup id="prtg.yes0no1" desiredValue="0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="PaeValueLookup.xsd" undefinedState="Warning">
<Lookups>
<SingleInt state="Ok" value="0">
Ok
</SingleInt>
<SingleInt state="Error" value="1">
Error
</SingleInt>
</Lookups>
</ValueLookup>
Rescan the lookup files (PRTG Console, setup, System Administration, Administrative tools, reload lookups)
Add sensor, Database, type Microsoft SQL v2
Sensor name : <NameOfSensor>
Database : <NameOfDatabase>
SqlQueryfile : Select the created SqlQueryFile <NameOfSqlSensorFile.sql>, it should be listed in the pulldown.
Data Processing : Process data table (if not selected now it cannot be selected later)
Select channel value by : Row Number
Sensor channel #1 name : Status
Sensor channel #1 row number : 0
Sensor channel #1 unit : Value Lookup
Sensor channel #1 Value Lookup : prtg.Yes0No1
All other values can be left at their default
Add comment