Is there any way to list out the probes object ID via the Web API, like the /api/table.xml.


Article Comments

Hello.

Have you checked the API's documentation?
It's accessible within your PRTG server under Setup > PRTG API.

In the current PRTG version (17.2.31) one can list out all PRTG Probes with the following query:

/api/table.xml?content=probes&output=xml&columns=objid,name&filter_parentid=0

Here we're using the filter_parentid=0 filter, since only probes can be a child object of the root, that query returns the complete probe list.

Best Regards,
Luciano Lingnau [Paessler Support]


May, 2015 - Permalink

Hello,

I couldn't find any api to grab data from the probe nodes (name,id). Please advise if it is possible.

I found a workaround to get the name of all probes by query groups' data from root (please see below code) but still no luck with getting their ids.

$prtgserver="your prtg address"

$authentication="&username=$prtgaccount&passhash=$prtghash"

$api="/api/table.xml?content=groups&output=csvtable&columns=objid,probe,name&id=0"

$probesList = Invoke-RestMethod "$prtgserver$api$authentication"|convertfrom-csv

$probesList = $probesList.Probe|sort-object |Get-Unique

May, 2017 - Permalink

Hello there,
thank you for your reply.

My suggestion above doesn't appear to work anymore, but the following will:

/api/table.xml?content=probes&output=xml&columns=objid,name&filter_parentid=0

The trick here is using filter_parentid=0 to filter only objects that are directly below the Root, who's ID is always 0.

Best Regards,
Luciano Lingnau [Paessler Support]


May, 2017 - Permalink

Thanks Luciano, just tested the api, it's working as expected.


May, 2017 - Permalink