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

Parent tag not display via api before the sensor is clicked

Votes:

0

Hi,

Im trying to get the parent tag of a device using the api in a powershell script. PRTG is at the newest update and you wont get a parent tag until you got on the Web UI on the device Settings and just click a few times around. Could it be that it is a bug or am i just doing something wrong?

This one works but only if you visited the Device on the WebUI Invoke-WebRequest -Uri "https:// **prtg** /api/getobjectproperty.htm?id= **deviceid** &name=parenttags&username=prtgadmin&passhash= **passwordhash**"

Thank you

api tags web-interface

Created on Aug 30, 2017 8:33:40 AM



3 Replies

Votes:

0

Hi Marco,

Username and passhash are correct? What result do you get from Invoke-Webrequest?


Kind regards,
Stephan Linke, Tech Support Team

Created on Aug 30, 2017 8:53:14 AM by  Stephan Linke [Paessler Support]



Votes:

0

Hi,

Yes im sure that those are correct since there is a reply getting to me.

Before visiting UI

PS C:\Powershell> Invoke-WebRequest -Uri "https:// prtg /api/getobjectproperty.htm?id=3843&name=parenttags&username=prtgadmin&passhash= "


StatusCode        : 200
StatusDescription : OK
Content           : <?xml version="1.0" encoding="UTF-8" ?>
                    <prtg>
                    <version>17.3.32.2478+</version>
                    <result></result>
                    </prtg>
RawContent        : HTTP/1.1 200 OK
                    Connection: close
                    X-Content-Type-Options: nosniff
                    X-XSS-Protection: 1; mode=block
                    Content-Length: 105
                    Cache-Control: no-cache
                    Content-Type: text/html; charset=UTF-8
                    Date: Wed, 3...
Forms             : {}
Headers           : {[Connection, close], [X-Content-Type-Options, nosniff], [X-XSS-Protection, 1; mode=block], [Content-Length, 105]...}
Images            : {}
InputFields       : {}
Links             : {}
ParsedHtml        : System.__ComObject
RawContentLength  : 105

After visiting Web Interface --> this host

PS C:\Powershell> Invoke-WebRequest -Uri "https:// prtg /api/getobjectproperty.htm?id=3843&name=parenttags&username=prtgadmin&passhash="


StatusCode        : 200
StatusDescription : OK
Content           : <?xml version="1.0" encoding="UTF-8" ?>
                    <prtg>
                    <version>17.3.32.2478+</version>
                    <result>Linux_SMS</result>
                    </prtg>
RawContent        : HTTP/1.1 200 OK
                    Connection: close
                    X-Content-Type-Options: nosniff
                    X-XSS-Protection: 1; mode=block
                    Content-Length: 114
                    Cache-Control: no-cache
                    Content-Type: text/html; charset=UTF-8
                    Date: Wed, 3...
Forms             : {}
Headers           : {[Connection, close], [X-Content-Type-Options, nosniff], [X-XSS-Protection, 1; mode=block], [Content-Length, 114]...}
Images            : {}
InputFields       : {}
Links             : {}
ParsedHtml        : System.__ComObject
RawContentLength  : 114




PS C:\Powershell> 

It's quite a problem for me since i want to get the tag wheter i visited this host recently or not.

Thank you

Created on Aug 30, 2017 9:19:27 AM



Votes:

0

Hi Marco,

Bug confirmed. I'll create an issue and link this thread to it. I'll let you know once it's fixed.
Would opening the device settings page via Invoke-Webrequest as an intermediate step work for you?
Because this will not be on high priority from what I can tell due to the low usage rate...


Kind regards,
Stephan Linke, Tech Support Team

Created on Aug 30, 2017 9:35:30 AM by  Stephan Linke [Paessler Support]

Last change on Aug 30, 2017 9:39:21 AM by  Stephan Linke [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.