Hello John,
Thank you for your message.
Regarding what you would like to achieve, I recommend to use the API of PRTG to get the list of the corresponding sensors to modify, and then add the name of the device they belong to.
To get a list of sensors with a specific tag, you can use this API call:
/api/table.json?content=sensors&columns=objid,name,probe,group,device,tags&noraw=1&count=*&filter_tags=@sub(YOUR_TAG)&username=PRTGUSER&passhash=PASSHASH
Then, to modify the name of a sensor you have to use the following request:
/api/rename.htm?id=SENSORID&value=NEW_NAME&username=PRTGUSER&passhash=PASSHASH
Here is the corresponding manual: https://www.paessler.com/manuals/prtg/object_manipulation
As the device name is included with each sensor (device property), you can use a loop to define the new name in a variable that you can pass to the query above.
If you have questions, let us know.
Regards.
Add comment