glpi-project / glpi-agent

GLPI Agent
GNU General Public License v2.0
212 stars 51 forks source link

RustDesk Remote ID failing to fetch #659

Closed jsbursik closed 2 months ago

jsbursik commented 2 months ago

Bug reporting acknowledgment

Yes, I read it

Professional support

Yes, I know

Describe the bug

On Windows 10 (22H2) and 11 (23H2) running RustDesk version 1.2.3-2, the Inventory task fails to fetch the Remote ID from RustDesk. When investigating the issue and looking at the RustDesk.pm code, I notice if it fails to find the ID in the RustDesk.toml file it will just try to run C:\Program Files\RustDesk\rustdesk.exe --version and then ... --get-id after it verifies the version. Researching further, this is a known issue, and in order to read the output you either need to pipe the output into a text file or more like so: C:\Program Files\Rustdesk\rustdesk.exe --get-id | more which will reveal the ID.

I have basically zero experience with perl, but trying to run the command through a system("C:\...\rustdesk.exe --get-id") I just get 0 as the output, but I can run system("C:\...\rustdesk.exe --get-id > out.txt") and see the id is in the out.txt file that is generated.

I also have a MeshCentral agent on the Windows 10 machine that will show up on inventory just fine.

To reproduce

  1. Install GLPI-Agent on Windows 10 or 11
  2. Install latest version of RustDesk (1.2.3-2)
  3. Force Inventory using GLPI-Agent httpd interface
  4. Inventory completes and shows up in GLPI, but the Remote Management tab is empty

Expected behavior

I would expect to see a RustDesk entry in the "Remote Management" tab with the ID for that machine listed.

Operating system

Windows

GLPI Agent version

1.7.3

GLPI version

10.0.x (See additional context below)

GLPIInventory plugin or other plugin version

GLPI Inventory v1.3.5

Additional context

GLPI 10.0.15

jsbursik commented 2 months ago

Forgot to mention - the ID is encoded in the .toml file now, so the first check will always fail over to the --version then --get-id steps.

g-bougard commented 2 months ago

Hi @jsbursik

this issue is probably a duplicated of #609.

As this is fixed in nightly builds, can you test a nightly build ? The fix will be included in v1.8, to be released in a week or 2.

jsbursik commented 2 months ago

Tested with GLPI-Agent v1.8-gitdbf3bd3c nightly, confirmed it is fixed in the nightly build.

Apologies, I stumbled upon that issue while researching and stopped reading when I saw it seemed related to the version regex and not the weird output issue.