Hello everybody, i want to find a specific sensor by it's objid. So i tried it with the use of the PRTG API.
When i enter this URL the Sensor is found:
https://prtg_url/sensor.htm?id=9885
But when i try this URL (using the API) the is not found:
https://prtg_url/api/table.xml?content=sensors&output=xml&columns=objid,sensor&id=9885
Can anybody help me out of this? Why can't i find my sensor using the API with the id?
Greetings Daniel
Article Comments
Hello,
thanks for the hint. In the meanwhile i found a working solution for the problem. I use &filter_objid= instead of only &id in the API call.
It works perfectly.
Greetings Daniel
Jul, 2022 - Permalink
Hello,
the part "id=" refers to the node in which the sensor is searched. It should be the parent device of the sensor, or one of the device groups in the structure, or probe node.
Then it returns all sensors of that node though. In order to get info about a single sensor (or other objects), you can query single properties using /api/getobjectproperty.htm?id=...
Jul, 2022 - Permalink