Linuxfabrik / monitoring-plugins

220+ check plugins for Icinga and other Nagios-compatible monitoring applications. Each plugin is a standalone command line tool (written in Python) that provides a specific type of check.
https://linuxfabrik.ch
The Unlicense
220 stars 51 forks source link

disk-usage: FileNotFoundError on Windows Server #712

Open mmartinello opened 1 year ago

mmartinello commented 1 year ago

This issue respects the following points:

Which variant of the Monitoring Plugins do you use?

Bug description

Running the disk-usage.exe plugin on two virtual machines running Windows Server 2019 I get this error:

PS C:\Program Files\ICINGA2\linuxfabrik> .\disk-usage.exe
Traceback (most recent call last):
  File "C:\PROGRA~1\ICINGA2\LINUXF~1\disk-usage", line 337, in 'module'
  File "C:\PROGRA~1\ICINGA2\LINUXF~1\disk-usage", line 206, in main
  File "C:\PROGRA~1\ICINGA2\LINUXF~1\psutil\__init__.py", line 2005, in disk_usage
  File "C:\PROGRA~1\ICINGA2\LINUXF~1\psutil\_pswindows.py", line 280, in disk_usage
FileNotFoundError: [WinError 3] The system cannot find the path specified: 'C'

This error is happening on two virtual machines running RDS Terminal Services and does not happen on all other similar virtual machines running the same operating system.

Steps to reproduce - Plugin call

.\disk-usage.exe

Steps to reproduce - Data

No response

Environment

Windows Server 2019

Plugin Version

disk-usage.exe: v2023051201 by Linuxfabrik GmbH, Zurich/Switzerland

Python version

No response

List of Python modules

No response

Additional Information

No response

markuslf commented 1 year ago

I installed "RDS Terminal Services" in Windows like so:

After a reboot, in "Services", I now have "Remote Desktop Services" (C:\Windows\System32\svchost.exe -k termsvcs) up and running, and disk-usage.exe still runs perfectly fine in Command Window (not tested in PowerShell).

So I can't reproduce this issue. Anything that I am missing @mmartinello?

mmartinello commented 1 year ago

So I can't reproduce this issue. Anything that I am missing @mmartinello?

These two servers are two full RDS environments installed with this feature:

Screenshot 2023-09-21 at 15 11 42

I really don't know if there is a feature which interferes with your plugin, maybe a special configuration on the RDS environment?

What I can tell you for sure is that these two VMs are completely like the same and they were installed in the same way (but not cloned).

Do you want to have a remote session with me so that we could debug the plugin on that specific machines?

markuslf commented 1 year ago

I tried to install the RDS as you did, but even after a Windows update, my Windows Srv 2019 fails to install RDS this way.

Debugging on your site requires installing the Python interpreter including some other 3rd party libraries via pip on one of these machines, and we can't do that for free. Would you mind sending your contact information to info at linuxfabrik dot ch to discuss some options?

Integratinator commented 1 year ago

I have the same issue, but no RDS installed. The plugin was working fine for more than a year. And today stopped working. Same error message, however I am using Windows Server 2022 Datacenter (21H2 Build 20348.2031).

Only updated the Microsoft Defender Antivirus yesterday to 1.399.1217.0. Checked for any blocked/removed file actions, but there are none.

markuslf commented 1 year ago

I am unable to reproduce this issue.

image

Any ideas?

Integratinator commented 1 year ago

Did another installation of windows updates. No errors now. No idea what caused or solved it, but it seems to be related to windows updates. (I agree about updates under Linux ;-) , but sadly we do not always have the choice.)

markuslf commented 1 year ago

Ok, good to know. Thanks for your feedback.

Integratinator commented 1 year ago

Not sure how, but after a reboot, the problem is back.

Integratinator commented 12 months ago

Today the problem has resolved itself. As far as I can see, nothing changed on the server. No updates, no scans, no crashed or restarted services. It is a mystery.

I am guessing it will be back after a reboot.

markuslf commented 12 months ago

Would be nice to know...