Is it possible to retrieve a list of devices that have no sensors configured yet?


Article Comments

Attention: This article is a record of a conversation with the Paessler support team. The information in this conversation is not updated to preserve the historical record. As a result, some of the information or recommendations in this conversation might be out of date.

The following script will allow you to do that. Simply save it as Get-EmptyDevices.ps1 and run it on the PRTG server within a PowerShell window:

[string] $ConfigurationFilePath = ((Get-ItemProperty -Path "hklm:SOFTWARE\Wow6432Node\Paessler\PRTG Network Monitor\Server\Core" -Name "Datapath").DataPath) + "PRTG Configuration.dat"
   [xml] $configuration = New-Object -TypeName XML;
         $configuration.Load($ConfigurationFilePath)

$Devices = ($configuration.SelectNodes("//device"))

$DeviceList = foreach ($Device in $Devices) 
{   

    $Sensors = ($configuration.SelectNodes("//device[@id='$($device.id)']/nodes/sensor").Count); 
 
    [pscustomobject]@{
        ObjectID = $Device.id
        Name     = $Device.data.name.Trim();
        Sensors  = $Sensors
        }

}

$DeviceList | Out-GridView

It will output a list similar to that: List of devices with no sensors


Oct, 2016 - Permalink