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 can I change or retrieve object settings of groups, devices or sensors using the API?

Votes:

0

I want to change the the properties of objects like devices and sensors using the PRTG API. How can I do this?

api prtg settings

Created on Feb 2, 2010 9:52:12 AM by  Dirk Paessler [Founder Paessler AG] (11,025) 3 6

Last change on Sep 23, 2015 1:57:09 PM by  Gerald Schoch [Paessler Support]



2 Replies

Accepted Answer

Votes:

0

This article applies to PRTG Network Monitor 15 or later

Changing Object Properties and Settings with the PRTG API

With the Application Programming Interface (API) of PRTG, you can read out and change properties of the objects in your device tree. The following API calls are available to get and set properties:

  • /api/getobjectproperty.htm?id=objectid&name=propertyname&show=text can read out properties and settings,
  • /api/setobjectproperty.htm?id=id_of_object&name=property_name&value=new_value can change properties and settings of objects.

This works for most boolean (values are 0 or 1), text-only, and number settings of groups, devices, sensors, maps, and reports. To find out what value you must use for the "name" parameter in the URL use a tool like Firebug and find out the "name" of the respective "<INPUT>" tag in the web interface of PRTG.

For example, the following API call gives the sensor with the ID 2621 the new tag API_set:

<your_PRTG_server>/api/setobjectproperty.htm?id=2621&name=tags&value=API_set

Note: It is not possible to read out or change passwords (including the SNMP community string) via the PRTG API. Fields that are defined as encrypted will appear masked for security reasons if you try to read them out.

For details about these API calls and other available options to read out or change objects, please see the API documentation.


For Deprecated PRTG Versions Only:

If you PRTG installation does not have the getobjectproperty.htm file in the /website/api folder yet please create this file, edit the file with a text editor and paste the following code into it:

<?xml version="1.0" encoding="UTF-8" ?>
<prtg>
<version><#system type="version"></version>
<result><#objectproperty show="number"></result>
</prtg>
<#checkobjecttype objecttype="sensor,group,device,probenode,map,report,user">

Created on Feb 2, 2010 10:28:29 AM by  Dirk Paessler [Founder Paessler AG] (11,025) 3 6

Last change on Aug 10, 2018 12:11:44 PM by  Brandy Greger [Paessler Support]



Votes:

0

How do I retrieve multiple properties of an object?

Created on Oct 11, 2013 8:21:53 PM




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.