question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Get-Sensor sometimes returns additional sensors that have no relationship to the input device and are from another probe

See original GitHub issue

So 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:closed
  • Created 2 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
lordmilkocommented, Sep 12, 2021

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

0reactions
ArchitektApxcommented, Sep 12, 2021

Thank you very much for troubleshooting this with me so quickly.

Let’s see what Paessler has to say about this 😢

Read more comments on GitHub >

github_iconTop Results From Across the Web

SensorManager
The values returned by this sensor cannot be trusted because the sensor had no contact with what it was measuring (for example, the...
Read more >
Adafruit BNO055 Absolute Orientation Sensor
The .getQuat function returns a Quaternion, which is often easier and more accurate to work with than Euler angles when doing sensor fusion...
Read more >
Fibaro binary input (Dual contact and temperature sensor)
Hi all, Ive been working on the Fibaro Universal Binary Sensor for a while now and have finally got it to a point...
Read more >
3.1: Working with sensor data · GitBook
Different Android devices have different sensors available, which means the SensorSurvey app shows different results for each device. In addition, the Android ...
Read more >
Sensors
A sensor defines an evaluation function that returns either: ... only guarantees that the sensor is not evaluated more frequently than the given...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found