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?


Article Comments

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>


Apr, 2018 - Permalink