New Question
 
 
PRTG Network Monitor

Intuitive to Use.
Easy to manage.

300.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


How do I extract values from XML

Votes:

0

Your Vote:

Up

Down

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"/>
</entry>

with the following XML Node field:

entry[@channel='1']/item[@d] 
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.

Channels:
Downtime		
Execution Time	
Value

prtg9 value xml

Created on Apr 27, 2015 7:12:01 AM by  Vozdr (10) 2

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



3 Replies

Votes:

0

Your Vote:

Up

Down

Hello,

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]



Votes:

1

Your Vote:

Up

Down

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

<result>
    <channel>CO Line</channel>
    <unit>Custom</unit>
    <CustomUnit>CO Line</CustomUnit>
    <Warning>0</Warning>
    <LimitMaxError>4</LimitMaxError>
    <LimitErrorMsg>Not ready</LimitErrorMsg>
    <ValueLookup>prtg.standardlookups.KTS_Status</ValueLookup>
    <value>4</value>
</result>
<result>
    <channel>Reg. status</channel>
    <unit>Custom</unit>
    <CustomUnit>Reg. status</CustomUnit>
    <Warning>0</Warning>
    <LimitMaxError>4</LimitMaxError>
    <LimitErrorMsg>Not ready</LimitErrorMsg>
    <ValueLookup>prtg.standardlookups.KTS_Status</ValueLookup>
    <value>4</value>
</result>
....

Created on Apr 28, 2015 11:05:04 AM by  Vozdr (10) 2

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



Votes:

0

Your Vote:

Up

Down

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]



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.