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

Please Help me for this script... I'am not DEV



Hello, I would like to be able to build a powershell script that would allow me to interface with APIs on a server and get the values ​​from prtg.

when I use the query:

Invoke-WebRequest -Uri "" -UsersOutBody \ text-xml Admin \ "-MethodBody \ text \ body \ xml Administrator \" -MethodutB \ body \ $ xmlAdmin \ "-UsersOutBody \ $ xml $ body = @ " <? xml version = "1.0"?> <xml> <object> controllerstaterx </object> <action> select </action> <id> 4 </id> </xml> "@

I have the following result:

<? xml version = "1.0"?> <xml> <result> <type> success </type> <message> </message> <errno> 0 </errno> <id> 4 </id> </result> <data> <bdrf> 65.6 </bdrf> <cn> 25 </cn> <rfl> 56.8 </rfl> <cn_sta_avg> 12.9 </cn_sta_avg> <cn_con_avg> 8.8 </cn_con_avg> <id> 4 </id> <hub_network_id> 1 </hub_network_id> <controller_id> 4 </controller_id> <packets> 0 </packets> <bad_state> 2021-11-19 07:29:10 </bad_state> <good_state> 2021-11-19 10:18:10 </good_state> <updated> 2021-11-19 10:18:05 </updated> <state> 17 </state> <channel> 4 </channel> <frlen> 256 </frlen> <rqsl> 3 </rqsl> <guarq> 3 </guarq> <totrq> 3 </totrq> <rtrq> 0 </rtrq> <upst> 5 </upst> <actst> 3 </actst> <hblow> 5 </hblow> <stlow> 0 </stlow> <rxspd> 10128 </rxspd> <platform> 34 </platform> <hardware> 1466715 </hardware> <hardware_errors> 0 </hardware_errors> <config_errors> 0 </config_errors> <license> 6146 </license> <configurable_profiles> 2147483647 </configurable_profiles> <licensed_profiles> 2147000307 </licensed_profiles> <faults> 0 </faults> </data> </xml>

My question: how to be able to create a power shell script to retrieve this result in the "form requested by the PRTG system

Thanks for your help jérémy

powershell prtg xml

Created on Nov 19, 2021 10:23:37 AM

Last change on Nov 22, 2021 8:47:50 AM by  Florian Lesage [Paessler Support]

1 Reply



Hi there,

First of all it depends which information should displayed in PRTG. Since the output is an XML you may work with the cmdlet Select-Xml in your script to filter the data you want to display.
Afterwards PRTG expect following to create channels and display your values:

           <channel>First channel</channel>
           <channel>Second channel</channel>

Kind regards

Felix Wiesneth - Team Tech Support

Created on Nov 24, 2021 6:19:31 AM by  Felix Wiesneth [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.