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">
Add comment