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

API - Get Device by sensor ID

Votes:

0

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

api deviceid sensorid

Created on Feb 20, 2020 11:46:22 AM



Best Answer

Accepted Answer

Votes:

1

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 [email protected] and we will be glad to help.

Created on Feb 21, 2020 7:53:54 PM by  Jonathan Mena [Paessler Technical Support]



3 Replies

Votes:

0

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.

Created on Feb 21, 2020 5:11:35 AM by  Jonathan Mena [Paessler Technical Support]



Votes:

0

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

Created on Feb 21, 2020 7:54:57 AM



Accepted Answer

Votes:

1

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 [email protected] and we will be glad to help.

Created on Feb 21, 2020 7:53:54 PM by  Jonathan Mena [Paessler Technical Support]




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.