Hello,
I hope someone might be able to spot what is going wrong or encountered a similar issue. I have a powershell script that I use to output JSON, but I've also tried XML. Regardless of what I'm using it keeps giving the error: XML: The returned XML does not match the expected schema. (code: PE233) -- JSON: The returned JSON does not match the expected structure (Invalid JSON.). (code: PE231).
I'm at a loss as to what's happening or what I'm missing. I even tried copy pasting the simple examples from the websites and the KB to see if those would work. They do not. So clearly something is happening. One of the first things I've checked is to make sure I'm using spaces in JSON and not tabs. I also it through Visual Studio Code to see if any mistakes/problems were detected. There is no other output being generated besides the write-output statement.
Is there a logfile that I can check to get a more accurate indication of the error?
Here's the JSON Powershell output snippet:
Write-Output @" { "prtg": { "result": [ { "channel": "70th", "value": "$70", "float": "1", "unit": "msec" }, { "channel": "80th", "value": "$80", "float": "1", "unit": "msec" } ] } } "@
Execution from Powershell:
PS C:\Program Files (x86)\PRTG Network Monitor\Custom Sensors\EXEXML> .\test.ps1 { "prtg": { "result": [ { "channel": "70th", "value": "", "float": "1", "unit": "msec" }, { "channel": "80th", "value": "9.50417999999998", "float": "1", "unit": "msec" } ] } }
The same error occurs when I use this simple example:
{ "prtg": { "result": [ { "channel": "First channel", "value": 10 }, { "channel": "Second channel", "value": 20 } ] } }
Add comment