Hello

1) I am getting ID of Sensor which are down

api/table.json?content=sensors&columns=objid,type&filter_status=5

2) And now i need to get IP adres (host) of Device, how can i achieve it?

I dont see any way how to filter device by one of sensor ID and i cant fetch all devices with sensor ID's

There is another way but its not best.

Get All Devices, get all sensor of all devices a check which sensors are down.

How can i get HOST(IP) of Device from Sensor ID?

Thank you


Article Comments

Hello,

Thank you for contacting us.

You can search the device by the sensor ID, the easy way would be to search using this URL <prtgIP>/sensor.htm?id=<sensorid> replacing the IP of the PRTG and the sensor ID that you want to search. That way you will reach the sensor with that ID.


Feb, 2020 - Permalink

Hello I am not sure how to use this with your API. I need to get device host by sensor ID on API. i tryed someting like that but its not working api/table.json?content=devices&output=json&columns=objid,host&sensor_id=5539 api/table.json?content=devices&output=json&columns=objid,host&sensor=5539 api/table.json?content=devices&output=json&columns=objid,host&filter_sensor=5773

I need to automate this process throw API


Feb, 2020 - Permalink

To get from a sensor to the host, we have a 2-step solution. first, call /api/getsensordetail.xml?id= to extract the parent-devide-id. For example /api/getsensordetails.xml?id=1001 Which is a default sensor. There you can find the Parent Device ID.

Then use this ID to get the host property of that device, you can do /api/table.csv?id=0&content=devices&columns=objid,name,host&count=* And it gets you the list of devices based on the Device ID, including the IP of this devices.

Or for an specific device you can do /api/getobjectproperty.htm if for example the Sensor ID 1001 has a Parent device ID of 40, it would be /api/getobjectproperty.htm?id=40&name=host

For more specific information regarding your implementation you can contact us at support@paessler.com and we will be glad to help.


Feb, 2020 - Permalink