PRTG Manual: Single Object Property
You can access live data and live status data of single objects using the PRTG API.
Authentication with API key or user name and passhash (or user name and password) must always be included in each PRTG API request. See section HTTP API for more information.
In this section:
You can get the properties or settings of an object (name, hostname, url) using the following API calls.
Because properties might contain HTML content, we recommend that you include &show=nohtmlencode in all getobjectproperty API calls.
Examples Get an object property/setting: /api/getobjectproperty.htm?id=objectid&name=propertyname&show=nohtmlencode For propertyname, look at the name of the INPUT fields while editing an object. You can discern the propertyname parameter by opening the Settings tab of an object and looking at the HTML source of the INPUT fields. For example, the INPUT field for the tags of an object has the name tags_. Leave away the underscore _ and use tags as a value for the propertyname parameter. /api/getobjectproperty.htm?id=1003&name=tags&show=nohtmlencode The Extensible Markup Language (XML) result looks like this: <?xml version="1.0" encoding="UTF-8" ?> |
getobjectproperty.htm supports the following object types:
- probe
- group
- device
- sensor
- channel
- library
- map
- notification
- report
- schedule
- user account
getobjectproperty.htm does not support the object types ticket and user group.
Name of Input Field |
Setting Name (as displayed in the PRTG web interface) |
---|---|
name |
Name |
limitmode |
Limit disabled or enabled (0 or 1) |
limitmaxerror |
Upper Error Limit |
limitmaxwarning |
Upper Warning Limit |
limitminwarning |
Lower Warning Limit |
limitminerror |
Lower Error Limit |
limiterrormsg |
Error Limit Message |
limitwarningmsg |
Warning Limit Message |
With this API call, you can get a sensor's channels settings, for example channel limits. In general, this works like getting properties of any other object. To get channel properties via the PRTG API, you need to provide
- the ID of a sensor (parameter id),
- a subtype (channel for channels), and
- a subid (ID of the channel that you want to edit)
Because properties might contain HTML content, we recommend that you include &show=nohtmlencode in all getobjectproperty API calls.
Examples Get a channel limit /api/getobjectproperty.htm?id=sensorid&subtype=channel&subid=channelid&name=limitname&show=nohtmlencode For example, the following API call gets the upper warning limit of a channel with the ID 0 of a sensor with the ID 1003 /api/getobjectproperty.htm?id=1003&subtype=channel&subid=0&name=limitmaxwarning&show=nohtmlencode The XML result looks like this: <?xml version="1.0" encoding="UTF-8" ?> |
KNOWLEDGE BASE
How can I use the PRTG Application Programming Interface (API)?