I have successfully added a Demo sensor using the Demo Batch file provide in the PRTG Windows installation.
C:\Program Files (x86)\PRTG Network Monitor\Custom Sensors\EXEXML\Demo Batchfile - Returns static values in four channels.bat
I'm now trying to program the exact equivalent in a Powershell Script, but so far it's not working.
I get the Sensor message "XML: The returned XML does not match the expected schema. (code: PE233)"
As far as I can tell the XML formatting is as it should be. I've also set Powershell script permissions to 'Unrestricted'.
As a simple Powershell test I've simplified the XML generated to something very basic, but still no luck.
Cannot find any log messages that may gives further debug information.
Windows Powershell file 'test.ps1' contents:
$result = "<?xml version=`"1.0`" encoding=`"UTF-8`" ?>`r`n"\\ $result += "<prtg>`r`n"\\ $result += "<result>`r`n"\\ $result += "<channel>Minimum</channel>`r`n"\\ $result += "<value>3</value>`r`n"\\ $result += "</result>`r`n"\\ $result += "<text>Test values. OS: %OS%</text>`r`n"\\ $result += "</prtg>`r`n"\\ write-host $result\\ exit 0 \\
Not sure why it's not working. What am I missing?
Would it be possible for you to please provide a working Powershell Script (.ps1) that performs the exact same function as the 'Demo Batchfile - Returns static values in four channels.bat'