I am looking for a way to create a report that will give me a list of all the devices and sensors associated with the device. I do not need graphics or data just a list in CSV or PDF format.


Article Comments

If you're on version 22.2.76.1705 you can use the PRTG API v2 (Seen on the new UI)

Also accessible via http(s):<prtgserver>:8080/api/v2/overview

You can export this with a simple powershell script:

Script starts with sign in, get a token, use the token to extract the data and then save it output.

An example would be(username, password and server URLs need to be updated):

$response = Invoke-RestMethod -Method 'POST' -Body '{"username": "prtgadmin", "password": "prtgadmin"}' 'http://prtgserver/api/v2/session' $token = $response.token $devices = Invoke-RestMethod -Method 'GET' -head @{"Authorization" = "Bearer $token"} 'http://prtgserver/api/v2/devices' $values = $devices | Select-Object -Property id,name,host,status_info | Export-Csv file.csv


May, 2022 - Permalink