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 can I use XPath with the HTTP XML/REST Value sensor?

Votes:

0

I would like to have more information about XPath usage when querying XML files.

help prtg xml xml-rest xpath

Created on Oct 13, 2011 1:27:08 PM by  Daniel Zobel [Product Manager]

Last change on Dec 10, 2020 10:10:05 AM by  Brandy Greger [Paessler Support]



1 Reply

Accepted Answer

Votes:

0

This article applies as of PRTG 22

Important notice: The syntax provided in this article is not fully compatible with the HTTP XML/REST Value sensor. This sensor type does not officially support the use of XPath. We cannot give you any technical support for XPath issues. This article is provided for your information only.

XPath

In the XML Node (and optional property) setting of the HTTP XML/REST Value sensor, you can try to use XPath. It can enable you to read, for example, values of arrays from .xml files. For example, use array[@name='myName'] to read all 'array' elements that have a 'name' attribute equal to 'myName'. A few more examples:

Get all sensors with a certain status: //status[text()='green']
Get all HTTP-based sensors from the PRTG configuration file (via PowerShell): sensor[@id][data/sensorkind[normalize-space(text())="http"]]

More

Created on Oct 13, 2011 1:30:27 PM by  Daniel Zobel [Product Manager]

Last change on Jan 2, 2023 2:36:50 PM by  Brandy Greger [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.