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

How do I extract values from XML



Hi. I try to get values of array from this XML using PRTG's HTTP XML/REST Value Sensor:

<entry channel="1" enabled="1" present="1">
<item t="text" r="1" d="Channel type">FXO</item>
<item t="text" r="1" d="Line status">Ready</item>
<item t="text" r="1" d="CO Line">Connected</item>
<item t="text" r="1" d="Reg. status">Registered</item>
<item t="int" r="0" d="SIP port">5061</item>
<item t="text" r="0" d="Call type"/>
<item t="text" r="1" d="Status">Idle</item>
<item t="int" r="0" d="Call limit">0</item>
<item t="int" r="0" d="Total duration">0</item>
<item t="text" r="0" d="Memo"/>

with the following XML Node field:

and I want to get all 'item' ellement in different channels, e.g.:
Channel type = FXO
Line status = Line status....

but now I get in this form:

Value = 0
Message = Node entry[@channel='1']/item[@d] holds value FXO.

Execution Time	

prtg9 value xml

Created on Apr 27, 2015 7:12:01 AM

Last change on Apr 27, 2015 9:43:28 AM by  Felix Saure [Paessler Support]

3 Replies




Thank you very much for using PRTG. Please bear in mind, the HTTP XML / REST Sensor can only gather one value in the value channel. Multiple channels are not possible.

best regards.

Created on Apr 28, 2015 10:58:25 AM by  Torsten Lindner [Paessler Support]



I wrote a program to convert the kind of CML at the right for "XML Custom EXE / Script sensor" in this form:

    <channel>CO Line</channel>
    <CustomUnit>CO Line</CustomUnit>
    <LimitErrorMsg>Not ready</LimitErrorMsg>
    <channel>Reg. status</channel>
    <CustomUnit>Reg. status</CustomUnit>
    <LimitErrorMsg>Not ready</LimitErrorMsg>

Created on Apr 28, 2015 11:05:04 AM

Last change on Apr 28, 2015 12:44:56 PM by  Torsten Lindner [Paessler Support]



That of course is a very good solution. Glad you could solve this!

Created on Apr 28, 2015 12:45:13 PM by  Torsten Lindner [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.