Dear, how can I get data from a sensor and export via api? the way I'm doing is giving me a wrong value example of the message

This XML file does not appear to have any style information associated with it. The document tree is shown below. <prtg> <version> 20.3.61.1649 </version> <error> Sorry, the selected object cannot be used here or it does not exist. </error> </prtg>


Article Comments

Hi Daniel,

It sounds like your API request is malformed

The syntax of an API request for a single sensor is as follows

https://prtg.example.com/api/table.xml?content=sensors&columns=objid,name,probe,group,favorite,lastvalue,device,downti
me,downtimetime,downtimesince,uptime,uptimetime,uptimesince,knowntime,cumsince,lastcheck,lastup,lastdown,minigraph,sche
dule,basetype,baselink,notifiesx,intervalx,access,dependency,position,status,comments,priority,message,parentid,tags,ty
pe,active&count=*&filter_objid=1001&username=prtgadmin&password=password

The filter_objid filter specifies the ID of the object to retrieve. In this example, this retrieves the XML for the single sensor with ID 1001

If you are using PowerShell, you can also do this a lot easier with PrtgAPI

Get-Sensor -Id 1001

Regards,

lordmilko


Nov, 2020 - Permalink

Thank you for your response Lordmilko.

I would also add the manual of the PRTG API, which includes the list of information we can get (included in your API request).

https://www.paessler.com/manuals/prtg/live_multiple_object_property_status

Regards.


Nov, 2020 - Permalink