Hi, Is there a way to export a sensor list with limits for each sensor? I Have hundreds of temperature sensor and I'd Like to know the limits (warning/error).

Table looks Like

Sensor ID - Name - Warning (limit) - Error (limit)

Thank You


Article Comments

Hello,

please take a look at

https://https://helpdesk.paessler.com/en/support/solutions/articles/76000063784

https://https://helpdesk.paessler.com/en/support/solutions/articles/76000063858


Aug, 2015 - Permalink

Thank you

but it's not my case. I know about the export of the sensor, but now I would like to export in fact a part of the 'configuration' of the sensors, like the limits (warning, error) configured on each.

it there a way? I now about csvexport and api, but I didn't read anything about my problem

regards


Aug, 2015 - Permalink

The following will also show it in a Gridview which allows you to filter:

param(
    $prtgProtocol   = "http",                   # http or https
    $prtghost       = "prtg.acme.com",  # the hostname, e.g. prtg.acme.com
    $prtgPort       = 80,                       # the port used by PRTG
    $prtgUser       = "prtgadmin",              # the username 
    $prtgPasshash   = 123456789                 # the user's passhash
)

$Sensors = ((Invoke-WebRequest -URI "$($prtgProtocol)://$($prtghost):$($prtgPort)/api/table.json?content=sensors&output=json&columns=objid,device,sensor&username=$($prtgUser)&passhash=$($prtgPasshash)").Content | ConvertFrom-Json)
$Devices = ((Invoke-WebRequest -URI "$($prtgProtocol)://$($prtghost):$($prtgPort)/api/table.json?content=devices&output=json&columns=objid,device&username=$($prtgUser)&passhash=$($prtgPasshash)").Content | ConvertFrom-Json)

$List = @();

$List.Clear();

Foreach($Device in $Devices.devices){
 
    $Sensors = ((Invoke-WebRequest -URI "$($prtgProtocol)://$($prtghost):$($prtgPort)/api/table.json?content=sensors&output=json&id=$($Device.objid)&columns=objid,device,sensor&username=$($prtgUser)&passhash=$($prtgPasshash)").Content | ConvertFrom-Json)

    Foreach($Sensor in $Sensors.sensors){

        $Channels = ((Invoke-WebRequest -URI "$($prtgProtocol)://$($prtghost):$($prtgPort)/api/table.json?content=channels&output=json&columns=name,lastvalue_,objid&id=$($sensor.objid)&username=$($prtgUser)&passhash=$($prtgPasshash)").Content | ConvertFrom-Json);

        Foreach($Channel in $Channels.channels){
            $ChannelSettings = (Invoke-WebRequest -Uri "$($prtgProtocol)://$($prtghost):$($prtgPort)/controls/channeledit.htm?_hjax=true&id=$($Sensor.objid)&channel=$($Channel.objid)&username=$($prtgUser)&passhash=$($prtgPasshash)"); 
            if(($channel.objid -eq -4) -or $Channel.name -eq "Execution Time"){ continue;} 
           
            $ChannelUnit = $ChannelSettings.InputFields.FindById("customunit_$($Channel.objid)").Value
            #$ChannelUnit = $ChannelSettings.InputFields.FindById("unit_$($Channel.objid)").Value

            [pscustomObject]$sensorItem = New-Object -TypeName psobject; 
                        
            $sensorItem | Add-Member -MemberType NoteProperty -Name "Object ID"           -Value $Device.objid
            $sensorItem | Add-Member -MemberType NoteProperty -Name "Device"              -Value $Device.device
            $sensorItem | Add-Member -MemberType NoteProperty -Name "Sensor ID"           -Value $Sensor.objid
            $sensorItem | Add-Member -MemberType NoteProperty -Name "Sensor"              -Value $Sensor.sensor
            $sensorItem | Add-Member -MemberType NoteProperty -Name "Channel ID"          -Value $Channel.objid
            $sensorItem | Add-Member -MemberType NoteProperty -Name "Channel Name"        -Value $Channel.name
            $sensorItem | Add-Member -MemberType NoteProperty -Name "Lower Warning Limit" -Value $ChannelSettings.InputFields.FindById("limitminwarning_$($Channel.objid)").value
            $sensorItem | Add-Member -MemberType NoteProperty -Name "Lower Error Limit"   -Value $ChannelSettings.InputFields.FindById("limitminerror_$($Channel.objid)").value
            $sensorItem | Add-Member -MemberType NoteProperty -Name "Upper Warning Limit" -Value $ChannelSettings.InputFields.FindById("limitmaxwarning_$($Channel.objid)").value
            $sensorItem | Add-Member -MemberType NoteProperty -Name "Upper Error Limit"   -Value $ChannelSettings.InputFields.FindById("limitmaxerror_$($Channel.objid)").value
            $sensorItem | Add-Member -MemberType NoteProperty -Name "Unit"                -Value $($ChannelUnit)

            $List += $sensorItem

        }
    }
}

$List | Out-GridView -Title "PRTG | Sensor Thresholds"

Aug, 2015 - Permalink

Or, if you prefer a User Interface you can use...

PTF ChannelLimits

PTF ChannelLimits is an application that allows you to get an overview of the channel limits of your sensors.

Check your Sensor Limits

Have you ever wondered if you have set and activated the correct threshold limits for all your temperature or disk space sensors? Stop wondering; using this tool, you will get an immediate overview!

Channel Limits

The tool can be downloaded from the PRTGToolsFamily website here.


Aug, 2015 - Permalink

Hi, I used the Get-Limits.ps1 script from - http://pastebin.com/f1Q6hs3E - very successfully. The only limitation is those sensors (eg the WMI Disk Free sensor) which hold limits on the sensor settings rather than in the channel settings. Paessler are telling me there is no way to get hold of those property names yet. Has anyone found a way to access them? Mark


Mar, 2017 - Permalink
ValueQuery
Lower Warning Percentapi/getobjectproperty.htm?id=<id>&name=lowerlimitwarningpct
Lower Error Percentapi/getobjectproperty.htm?id=<id>&name=lowerlimiterrorpct
Upper Warning Percentapi/getobjectproperty.htm?id=<id>&name=upperlimitwarningpct
Upper Error Percentapi/getobjectproperty.htm?id=<id>&name=upperlimiterrorpct

Note This works only for sensors that have limits configured in their sensor settings. Channel limit settings cannot be read with that.



Mar, 2017 - Permalink

Hi there,

this doesn't seem to work anymore in 22.2.77.2204+. (Invoke-WebRequest -Uri "$($prtgProtocol)://$($prtghost):$($prtgPort)/controls/channeledit.htm?_hjax=true&id=$($Sensor.objid)&channel=$($Channel.objid)&username=$($prtgUser)&passhash=$($prtgPasshash)"); doesn't seem to yield something that can be interpreted as XML or JSON and ist html instead. Is there an API option to yield the channel limit settings as a JSON object?


Aug, 2022 - Permalink

You can change the output format of the API call; have a look here


Aug, 2022 - Permalink