Get-Sensor sometimes returns additional sensors that have no relationship to the input device and are from another probe
See original GitHub issueSo this hit me in production right now doing a Remove-Object -force
😦
It occured directly on the core server of a large Install (~11k Sensors) which sometimes causes all kinds of funny stuff tbh but the additionally returned sensors had literally nothing in common with the device that was inputed to Get-Sensor. The “wrongfully” fetched sensors:
- are on a different probe
- differently named parent device
- differently named parent groups
- share no connection (triggers, dependencies, schedules) whatsoever with the correct device
- ???
Problem doesn’t occure with every device just a small amount of them but is reproduceable (at least for sensors that were not deleted)
Steps to reproduce
# simple version of what my code was doing but has the exact same result
# Get all Devices in the Group 'Servers OFFICE'
# Sort the returned devices by name
$OFFICEServers = Get-Device -Group 'Server OFFICE' | Sort-Object Name
$OFFICEServers[8]
# Element 8 is exactly the Server I expect from an alphabetical sorting
# All Devices in $OFFICEServers are exactly the ones I expect
# All of these Devices are direct childs of the `Server OFFICE` Group
Name Id Status Host Sensors Group Probe
---- -- ------ ---- ------- ----- -----
ExampleServer 5902 Up ExampleServer 11 Server OFFICE Local Probe
# When using Get-Sensor on said device the return contains all the correct child sensors of $OFFICEServers[8]
# but also completly unrelated sensors
Name Id Device Group Probe Status
---- -- ------ ----- ----- ------
PING 5903 ExampleServer Server OFFICE Local Probe Up
Laufzeit 14141 ExampleServer Server OFFICE Local Probe Up
Physical Memory 29313 ExampleServer Server OFFICE Local Probe Up
Prozessorlast 29314 ExampleServer Server OFFICE Local Probe Up
vmxnet3 Ethernet Adapter 57273 ExampleServer Server OFFICE Local Probe Up
Disk Free: C:\ Label: Seria… 58885 ExampleServer Server OFFICE Local Probe Up
Disk Free: D:\ Label:Data S… 58886 ExampleServer Server OFFICE Local Probe Up
Disk Free: E:\ Label:Files … 62438 ExampleServer Server OFFICE Local Probe Up
Service SNMP Service 62885 ExampleServer Server OFFICE Local Probe Up
Service Windows Defender An… 62887 ExampleServer Server OFFICE Local Probe Up
RDP 63259 ExampleServer Server OFFICE Local Probe Up
redacteddomain.com 59294 redacteddomain.com Serv1 RZ-Office Up
SSL Security Check 59295 redacteddomain.com Serv2 RZ-Office Up
redacteddomain.com 59296 redacteddomain.com Serv3 RZ-Office Up
redacteddomain.com 59298 redacteddomain.com Serv3 RZ-Office Up
redacteddomain.com 59300 redacteddomain.com Serv1 RZ-Office Up
redacteddomain.com 59302 redacteddomain.com Serv2 RZ-Office Up
redacteddomain.com 59827 redacteddomain.com Azure RZ-Office Up
SSL Security Check 59828 redacteddomain.com Azure RZ-Office Up
# Whats even funnier, is that other ways of calling the "same thing" results in a different amount of
# false sensors. but it's the same with each everytime so this will always return 3 additional sensors
# and those 3 sensors are always the same (and are a subset of the wrong sensors from the previous example)
# like before just what we expect
Get-Device -Group 'Server OFFICE' | ? { $_.Name -match 'ExampleServer'}
Name Id Status Host Sensors Group Probe
---- -- ------ ---- ------- ----- -----
ExampleServer 5902 Up ExampleServer 11 Server OFFICE Local Probe
# well .. not really
Get-Device -Group 'Server OFFICE' | ? { $_.Name -match 'ExampleServer'} | Get-Sensor
Name Id Device Group Probe Status
---- -- ------ ----- ----- ------
PING 5903 ExampleServer Server OFFICE Local Probe Up
Laufzeit 14141 ExampleServer Server OFFICE Local Probe Up
Physical Memory 29313 ExampleServer Server OFFICE Local Probe Up
Prozessorlast 29314 ExampleServer Server OFFICE Local Probe Up
vmxnet3 Ethernet Adapter 57273 ExampleServer Server OFFICE Local Probe Up
Disk Free: C:\ Label: Seria… 58885 ExampleServer Server OFFICE Local Probe Up
Disk Free: D:\ Label:Data S… 58886 ExampleServer Server OFFICE Local Probe Up
Disk Free: E:\ Label:Files … 62438 ExampleServer Server OFFICE Local Probe Up
Service SNMP Service 62885 ExampleServer Server OFFICE Local Probe Up
Service Windows Defender An… 62887 ExampleServer Server OFFICE Local Probe Up
RDP 63259 ExampleServer Server OFFICE Local Probe Up
redacteddomain.com 59294 redacteddomain.com Serv1 RZ-Office Up
SSL Security Check 59295 redacteddomain.com Serv2 RZ-Office Up
redacteddomain.com 59296 redacteddomain.com Serv3 RZ-Office Up
# Same thing happens piping directly into Get-Sensor
Get-Device -Name ExampleServ*
Name Id Status Host Sensors Group Probe
---- -- ------ ---- ------- ----- -----
ExampleServer 5902 Up ExampleServer 11 Server OFFICE Local Probe
# Same subset of 3 wrong sensors
Get-Device -Name SV289* | Get-Sensor
Name Id Device Group Probe Status
---- -- ------ ----- ----- ------
PING 5903 ExampleServer Server OFFICE Local Probe Up
Laufzeit 14141 ExampleServer Server OFFICE Local Probe Up
Physical Memory 29313 ExampleServer Server OFFICE Local Probe Up
Prozessorlast 29314 ExampleServer Server OFFICE Local Probe Up
vmxnet3 Ethernet Adapter 57273 ExampleServer Server OFFICE Local Probe Up
Disk Free: C:\ Label: Seria… 58885 ExampleServer Server OFFICE Local Probe Up
Disk Free: D:\ Label:Data S… 58886 ExampleServer Server OFFICE Local Probe Up
Disk Free: E:\ Label:Files … 62438 ExampleServer Server OFFICE Local Probe Up
Service SNMP Service 62885 ExampleServer Server OFFICE Local Probe Up
Service Windows Defender An… 62887 ExampleServer Server OFFICE Local Probe Up
RDP 63259 ExampleServer Server OFFICE Local Probe Up
redacteddomain.com 59294 redacteddomain.com Serv1 RZ-Office Up
SSL Security Check 59295 redacteddomain.com Serv2 RZ-Office Up
redacteddomain.com 59296 redacteddomain.com Serv3 RZ-Office Up
# and last but not least just for shits'n'giggles
Get-Probe -Name 'Local Probe' | Get-Group 'Server OFFICE' | Get-Device -Name 'ExampleServ*'
Name Id Status Host Sensors Group Probe
---- -- ------ ---- ------- ----- -----
ExampleServer 5902 Up ExampleServer 11 Server OFFICE Local Probe
Get-Probe -Name 'Local Probe' | Get-Group 'Server OFFICE' | Get-Device -Name 'ExampleServ*' | Get-Sensor
Name Id Device Group Probe Status
---- -- ------ ----- ----- ------
PING 5903 ExampleServer Server OFFICE Local Probe Up
Laufzeit 14141 ExampleServer Server OFFICE Local Probe Up
Physical Memory 29313 ExampleServer Server OFFICE Local Probe Up
Prozessorlast 29314 ExampleServer Server OFFICE Local Probe Up
vmxnet3 Ethernet Adapter 57273 ExampleServer Server OFFICE Local Probe Up
Disk Free: C:\ Label: Seria… 58885 ExampleServer Server OFFICE Local Probe Up
Disk Free: D:\ Label:Data S… 58886 ExampleServer Server OFFICE Local Probe Up
Disk Free: E:\ Label:Files … 62438 ExampleServer Server OFFICE Local Probe Up
Service SNMP Service 62885 ExampleServer Server OFFICE Local Probe Up
Service Windows Defender An… 62887 ExampleServer Server OFFICE Local Probe Up
RDP 63259 ExampleServer Server OFFICE Local Probe Up
redacteddomain.com 59294 redacteddomain.com Serv1 RZ-Office Up
SSL Security Check 59295 redacteddomain.com Serv2 RZ-Office Up
redacteddomain.com 59296 redacteddomain.com Serv3 RZ-Office Up
redacteddomain.com 59298 redacteddomain.com Serv3 RZ-Office Up
redacteddomain.com 59300 redacteddomain.com Serv1 RZ-Office Up
redacteddomain.com 59302 redacteddomain.com Serv2 RZ-Office Up
redacteddomain.com 59827 redacteddomain.com Azure RZ-Office Up
SSL Security Check 59828 redacteddomain.com Azure RZ-Office Up
What is the output of Get-PrtgClient -Diagnostic
?
PSVersion : 7.1.3
PSEdition : Core
OS : Linux 5.12.19-1-MANJARO #1 SMP PREEMPT Tue Jul 20 20:57:37 UTC 2021
PrtgAPIVersion : 0.9.16
Culture : de-DE
CLRVersion : .NETCoreApp,Version=v5.0
PrtgVersion : 21.3.70.1629
PrtgLanguage : german.lng
Additional context Like stated I can exactly reproduce the behaviour with some devices, absolutely not sure why this is happening tho. Output is from my real shell, only stuff that is confidential/business stuff was redacted. IDs are literally the same
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (3 by maintainers)
Top GitHub Comments
Thanks @ArchitektApx,
As this appears to be an issue with PRTG rather than PrtgAPI, I would recommend opening a support case with Paessler. When liaising with Paessler, be sure to stress that this issue is present when executing API calls against PRTG directly, so that they don’t get distracted by the fact that PrtgAPI is a third party product and thus not supported by them
Regards, lordmilko
Thank you very much for troubleshooting this with me so quickly.
Let’s see what Paessler has to say about this 😢