I need to create a data dump for a list of my sensors. I would prefer to export the sensor list into an XML Format, but will settle for .CSV. I'm currently playing around with the API v2, but am having a difficult time in trying to figure out how and where to create the report. Can anyone assist me with this or have experience with creating such a report? It just needs to show the name of the device/sensor and it's associated IP.


Article Comments

Hello,

Thanks for contacting us.

I believe this might help you in a way to use it as reference:

$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://prgtgserver/api/v2/devices'

$values = $devices | Select-Object -Property id,name,host,status_info | Export-Csv file.csv

Regards,

Miguel Aikens


Aug, 2022 - Permalink