If you have a working powershell script that returns a numerical value and you want to read/use that value with PRTG. There are two API Formats that you can use, regardless of scripting language:
The "XML" output, as exemplified here(output):
<prtg>
<result>
<channel>First channel</channel>
<value>10</value>
</result>
<text>This is the sensors optional text</text>
</prtg>
The "standard" format, as exemplified here(code):
Write-Host "10:This is the sensors optional text"
exit 0
For more information, see PRTG Manual: Custom Sensors
Please note that if your query provides a numerical result directly, you should also be able to use the built-in SQL v2 sensors:
PRTG Manual: Microsoft SQL v2 Sensor
You can find examples for the SQL Sensors here:
Best Regards,
Luciano Lingnau [Paessler Support]
Add comment