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 read Tags from Objects using a script

Votes:

0

Is there a way to read the Tags of an Object or a Sensor yet? I did check the knowledge database and only caught the list with the variables, but i couldnt find a variable to get the tags. And if its not possible is there any workaround or is it something planned for the future?

Thanks for your answer

parameters tags variables

Created on May 5, 2017 8:38:50 AM



Best Answer

Accepted Answer

Votes:

0

There's no placeholder for the tags; you'll need to read them via API and log them separately :/

Created on May 5, 2017 11:16:00 AM by  Stephan Linke [Paessler Support]



5 Replies

Votes:

0

Hi there,

The following API call should do the trick: /api/getobjectproperty.htm?id=<object id>&name=tags

Writing them can be done via /api/setobjectproperty.htm?id=<object id>&name=tags

Note that you'll need to get the tags first, modify the string (comma separated) and then set it again. Otherwise you'll always overwrite them and configuration changes made prior might get lost.

Created on May 5, 2017 9:06:43 AM by  Stephan Linke [Paessler Support]

Last change on May 5, 2017 9:25:37 AM by  Stephan Linke [Paessler Support]



Votes:

0

Thanks for the fast reply.

I unfortunatly did not specify my question enough. Is there a way to write that to the Eventlog?

Created on May 5, 2017 9:30:59 AM



Votes:

0

Write what exactly to the event log? The tag? Depends on what language you're using.
PowerShell would look something like this: Write-EventLog -LogName Application -Source “My Script” -EntryType Information -EventID 1 -Message “This is a test message.”

Created on May 5, 2017 9:42:03 AM by  Stephan Linke [Paessler Support]

Last change on May 5, 2017 9:42:17 AM by  Stephan Linke [Paessler Support]



Votes:

0

At the Moment i have a Notification that adds a eventlog entry on every trigger. And i would like to add the tags of the device to the eventlog.

Something like this

%device | %name | status | %down (%message) | %tag

The question is how to submit the Tags that were defined in PRTG

Created on May 5, 2017 10:57:29 AM



Accepted Answer

Votes:

0

There's no placeholder for the tags; you'll need to read them via API and log them separately :/

Created on May 5, 2017 11:16:00 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.