New Question
 
 
PRTG Network Monitor

Intuitive to Use.
Easy to manage.

200.000 administrators have chosen PRTG to monitor their network. Find out how you can reduce cost, increase QoS and ease planning, as well.

Free PRTG
Download >>

 

What is this?

This knowledgebase contains questions and answers about PRTG Network Monitor and network monitoring in general. You are invited to get involved by asking and answering questions!

Learn more

 

Top Tags


View all Tags


API Sensor status request

Votes:

0

Your Vote:

Up

Down

good evening i need an api request that returns me the status of a sensor by device ip and sensor name, how the request will be and i need the response as booelan.

api ptrg request

Created on Sep 22, 2016 10:10:33 PM by  CINECO (0) 1



1 Reply

Votes:

0

Your Vote:

Up

Down

Dear Cineco

This is a bit more complicated. The PRTG API identifies a sensor by its object ID. The status is not provided as boolean, is is encoded with an integer where value 3 is up, while other statuses are not up (down, warning, paused and so on.)

Devices are identified by their object ID as well. If you put the IP into the settings tab instead of the host name, you can iterate over each device and look for the ID in question. Using the object ID found, you can create a sensor list just for this device and look for a name. The relevant documentation is available via the PRTG webinterface, menu Setup | PRTG API.

Here is an example call for the device list:

/api/table.csv?content=devices&columns=objid,name,host,probegroupdevice=text,status&count=*

Lets say the device in question has the ID 2099 and you now need a sensor list for that device. That looks like

/api/table.csv?id=2099&content=sensors&columns=objid,device=text,sensor=htmllong,status,message,lastvalue,comments&count=*

If you prefer an XML output over CSV, replace table.csv with table.xml.

Created on Sep 23, 2016 9:29:03 AM by  Arne Seifert [Paessler Support]



Please log in or register to enter your reply.


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.