What is this?

This knowledgebase contains questions and answers about PRTG Network Monitor and network monitoring in general.

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

Why does PRTG note what happens outside of Write-Host <prtg>?



Hello, I have a script for a EXE/Script Advanced Sensor. However, the sensor does not work. Error from PRTG Dashboard: "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)"

When looking at the log files I noticed the following, the result contains events that occur outside of Write-Host <prtg> ... Write-Host</prtg> happened. Why does PRTG behave like this? Can this be my error?

Example: Write-Host "Test Message" Write-Host "<prtg>" Write-Host "<result>" "<channel>backup</channel>" "<value>1</value>" "<text>backup finished</text>" "<LimitMinError>0</LimitMinError>" "<LimitMode>1</LimitMode>" "</result>" Write-Host "</prtg>"

Result of Sensor: Test Message <prtg> <result> <channel>Backup</channel>. <value>1</value> <text>backup finished</text>. <LimitMinError>0</LimitMinError> <LimitMode>1</LimitMode> </result> </prtg>

It should have ignored Write-Host "Test Message" or?

exe-script-advanced-sensor prtg sensor

Created on Dec 22, 2020 1:12:29 PM

4 Replies




that sensor output would be accepted. If you get an error, please check the real sensor output you get with "Store result" in the sensor options. I suspect you get an error message then?

Created on Dec 22, 2020 2:05:26 PM by  Arne Seifert [Paessler Support]



Result of Sensor xxxxx:

Test Message
<text>backup finished</text>.

Result of Sensor xxxxx.Data:

Data['lastmsg'].asString := '#Y2 @#0233 @#231[Invaldid JSON.]';

There are also other lines, but I don't think they are helpful in solving the problem. If they are I will add them

Created on Dec 22, 2020 3:04:26 PM




I have been able to find the problem but not how to solve it. This is my code: Connect-IPPSSession -Credential $Credential -ConnectionUri $connection # Creates the problem Write-Host "Text Message" # Doesn't create a problem. Write Host "<prtg> <result> <channel>First channel</channel> <value>10</value> </result> </prtg>"

So the problem is "Connect-IPPSSession" when I have this in my code i get the error: XML: Das zurückgelieferte XML entspricht nicht dem erwarteten Schema. (Code: PE233) -- JSON: Das zurückgelieferte JSON entspricht nicht der erwarteten Struktur (Invalid JSON.). (Code: PE231)} Do you have any idea why "Connect-IPPSSession" cannot be used? Sounds strange

Created on Dec 22, 2020 4:26:48 PM



Does Connect-IPPSSession create additional text written to the console, or an error message resulting in having no XML at all. To check, please first delete the existing result log, to see if you get any result at all if you include that command.

Created on Dec 28, 2020 2:34:51 PM by  Arne Seifert [Paessler Support]

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.