New Question
 
 
PRTG Network Monitor

Intuitive to Use.
Easy to manage.

200.000 administrators have chosen PRTG to monitor their network. Find out how you can reduce cost, increase QoS and ease planning, as well.

Free PRTG
Download >>

 

What is this?

This knowledgebase contains questions and answers about PRTG Network Monitor and network monitoring in general. You are invited to get involved by asking and answering questions!

Learn more

 

Top Tags


View all Tags


Junk after document element error in XML sensor

Votes:

0

Your Vote:

Up

Down

I'm having a problem creating a sensor that keeps flagging errors no matter what I try to use to create the XML. I use the same select for this xml string as across almost all sensors we use.

The error is: XML: Junk after document element </prtg> -- JSON: The returned JSON does not match the expected structure (Invalid JSON.). (code: PE231)

The XML we output is below (broken down so it easier to read): <?xml version="1.0" encoding="Windows-1252"?><prtg><result> <channel>Last Loaded</channel> <value>11</value> <unit>TimeHours</unit> <showchart>1</showchart> <showtable>1</showtable> <LimitMaxError>24</LimitMaxError> <LimitErrorMsg>File Not Loaded</LimitErrorMsg> <LimitMode>1</LimitMode></result> <result> <channel>Stuck File</channel> <value>0</value> <showchart>1</showchart> <showtable>1</showtable> <LimitMaxError>1</LimitMaxError> <LimitErrorMsg>File Is Stuck</LimitErrorMsg> <LimitMode>1</LimitMode> </result><text></text></prtg>

Is there some obvious thing that I am missing here?

custom-sensor prtg xml

Created on Apr 13, 2018 12:20:01 AM by  J (0) 1



1 Reply

Votes:

0

Your Vote:

Up

Down

I would guess your code contains something after </prtg>

I got the same error if I did something like this: (line 49)

Or it is not structured like it should be.. Maybe an output like this would be better: <prtg> <result> <channel>Last Loaded</channel> <value>11</value> <unit>TimeHours</unit> <showchart>1</showchart> <showtable>1</showtable> <LimitMaxError>24</LimitMaxError> <LimitErrorMsg>File Not Loaded</LimitErrorMsg> <LimitMode>1</LimitMode> </result> <result> <channel>Stuck File</channel> <value>0</value> <showchart>1</showchart> <showtable>1</showtable> <LimitMaxError>1</LimitMaxError> <LimitErrorMsg>File Is Stuck</LimitErrorMsg> <LimitMode>1</LimitMode> </result> <text></text> </prtg>

Created on Apr 13, 2018 10:33:40 AM by  Lukas (320) 2 1

Last change on Apr 13, 2018 12:34:41 PM by  Arne Seifert [Paessler Support]



Please log in or register to enter your reply.


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.