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

Votes:

0

Your Vote:

Up

Down

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 by  Marco Martinez (0) 1



Best Answer

Accepted Answer

Votes:

0

Your Vote:

Up

Down

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

Your Vote:

Up

Down

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

Your Vote:

Up

Down

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 by  Marco Martinez (0) 1



Votes:

0

Your Vote:

Up

Down

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

Your Vote:

Up

Down

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 by  Marco Martinez (0) 1



Accepted Answer

Votes:

0

Your Vote:

Up

Down

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]



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.