I'm trying to get XML Custom EXE sensor to work in PRTG.
I want a sensor to grab data from a webpage and display the results in PRTG. We have created an EXE in c# that authenticates the webpage and grabs the data and returns it in XML, memory only, no file written. However I keep getting the error:
| XML: The returned XML does not match the expected schema. (code: PE233) |
Our output:
<prtg>
<result>
<channel>Type</channel>
<value>Service</value>
</result>
<result>
<channel>Unit</channel>
<value>PH</value>
</result>
<result>
<channel>Label</channel>
<value></value>
</result>
<result>
<channel>Slot</channel>
<value>A</value>
</result>
<result>
<channel>HW Version</channel>
<value>3.62</value>
</result>
<result>
<channel>Serial Number</channel>
<value>030362002110</value>
</result>
<result>
<channel>Downlink RF Power (dBm)</channel>
<value>-37.1</value>
</result>
<result>
<channel>Alarm Count</channel>
<value>0</value>
</result>
<result>
<channel>Alarms</channel>
<value>None</value>
</result>
<result>
<channel>Max input power (dBm)</channel>
<value>4</value>
</result>
<result>
<channel>Module State</channel>
<value>Open</value>
</result>
<result>
<channel>Uplink Gain (dB)</channel>
<value>1</value>
</result>
<result>
<channel>Downlink Gain (dB)</channel>
<value>-5</value>
</result>
</prtg>
Any ideas what we are missing in this output?
Thanks for the assistance.
Article Comments
Attention: This article is a record of a conversation with the Paessler support team. The information in this conversation is not updated to preserve the historical record. As a result, some of the information or recommendations in this conversation might be out of date.
Channels can only hold an integer or float value. Text values like below are not allowed!
<result>
<channel>Type</channel>
<value>Service</value>
</result>
Nov, 2015 - Permalink
Ok, here is our updated output and now we are getting a Response not well formed
<?xml version="1.0" encoding="UTF-8" ?> <prtg> <result> <channel>1</channel> <text>Type</text> <text>Service</text> </result> <result> <channel>2</channel> <text>Unit</text> <text>PH</text> </result> <result> <channel>3</channel> <text>Label</text> </result> <result> <channel>4</channel> <text>Slot</text> <text>A</text> </result> <result> <channel>5</channel> <text>HW Version</text> <value>3.62</value> </result> <result> <channel>6</channel> <text>Serial Number</text> <value>030362002110</value> </result> <result> <channel>7</channel> <text>Downlink RF Power (dBm)</text> <value>-37.1</value> </result> <result> <channel>8</channel> <text>Alarm Count</text> <value>0</value> </result> <result> <channel>9</channel> <text>Alarms</text> <text>None</text> </result> <result> <channel>10</channel> <text>Max input power (dBm)</text> <value>4</value> </result> <result> <channel>11</channel> <text>Module State</text> <text>Open</text> </result> <result> <channel>12</channel> <text>Uplink Gain (dB)</text> <value>1</value> </result> <result> <channel>13</channel> <text>Downlink Gain (dB)</text> <value>-5</value> </result> </prtg>
Nov, 2015 - Permalink
Hi,
please make sure in your xml the following tags are present only once per <result>:
<result> <channel>CHANNEL NAME</channel> <value>NUMERICAL VALUE</value> </result>
the <text> tag has to be outside of any result tab but within the <prtg> tag.
Nov, 2015 - Permalink
Hi,
Ok we got it working. Now an issue is that some information we are displaying has a negative value (-37.5) this displays as zero (0). Where as another value -5 displays correctly.
Suggestions?
Nov, 2015 - Permalink
Hi,
in the <result> tag you are returning the -37,5 please add <float>1</float>. Then it should show correctly.
Nov, 2015 - Permalink
Hi,
in the sensor Settings please activate the option "Write Result to Disk". What results do you get there?
Nov, 2015 - Permalink