New Question
 
 
PRTG Network Monitor

Intuitive to Use.
Easy to manage.

200.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 to get a list of sensor tags without parent tags via API?

Votes:

0

Your Vote:

Up

Down

I tried to get a list of tags from sensors, but API returned me a string consists of parent tags and sensor tags.

API request:

https://XXX/api/table.xml?content=sensors&id=6205&columns=objid,device,name,tags&username=XXX&password=XXX

in XML file i have this in tags column - "bandwidthsensor snmptrafficsensor vendors_Cisco voicegw sd-uc-voice UC"

bandwidthsensor snmptrafficsensor - this are sensor tags

vendors_Cisco voicegw sd-uc-voice UC - this are parent tags

Can I get only sensor tags without parent tags somehow?

api get tags

Created on Nov 5, 2018 1:46:55 PM by  Vitaliy Abuzov (0) 1

Last change on Nov 6, 2018 1:19:07 PM by  Isidora Jeremic [Paessler Support]



Best Answer

Accepted Answer

Votes:

2

Your Vote:

Up

Down

You can retrieve the separate Tags and ParentTags of objects using the Get-ObjectProperty cmdlet of PrtgAPI

C:\> Get-Sensor | Get-ObjectProperty | select *tag*

ParentTags    Tags
----------    ----
{Contoso}     {systemhealthsensor}

Regards,

lordmilko

Created on Nov 8, 2018 8:47:42 AM by  lordmilko (1,432) 2 1



5 Replies

Votes:

0

Your Vote:

Up

Down

Hello Vitaliy,

Thank you for your KB-post.

I am afraid that this cannot be changed. When using the column "tags" in API requests, it will always return list of all tags for the object - this includes tags from the object itself plus those inherited from parent objects.

Best regards

Created on Nov 6, 2018 1:53:34 PM by  Isidora Jeremic [Paessler Support]



Votes:

0

Your Vote:

Up

Down

Hello Isidora! How can i add new tag to sensor via API?

Created on Nov 7, 2018 11:16:36 AM by  Vitaliy Abuzov (0) 1



Votes:

1

Your Vote:

Up

Down

Hi Vitaliy,

I am afraid that is not possible by using default API options in PRTG.

However, you might want to try PrtgAPI using Powershell to achieve this.

Best regards

Created on Nov 8, 2018 8:36:43 AM by  Isidora Jeremic [Paessler Support]



Accepted Answer

Votes:

2

Your Vote:

Up

Down

You can retrieve the separate Tags and ParentTags of objects using the Get-ObjectProperty cmdlet of PrtgAPI

C:\> Get-Sensor | Get-ObjectProperty | select *tag*

ParentTags    Tags
----------    ----
{Contoso}     {systemhealthsensor}

Regards,

lordmilko

Created on Nov 8, 2018 8:47:42 AM by  lordmilko (1,432) 2 1



Votes:

0

Your Vote:

Up

Down

Thank you Lordmilko! :)

Created on Nov 8, 2018 9:14:56 AM by  Isidora Jeremic [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.