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

Votes:

0

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

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



Best Answer

Accepted Answer

Votes:

2

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



5 Replies

Votes:

0

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

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

Created on Nov 7, 2018 11:16:36 AM



Votes:

1

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

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



Votes:

0

Thank you Lordmilko! :)

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