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


Article Comments

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