-
-
Notifications
You must be signed in to change notification settings - Fork 62
Description
This issue respects the following points:
- This is a bug, not a question or a setup/configuration issue.
- This issue is not already reported on Github (I've searched it).
- I use the latest release of the Monitoring Plugins (https://github.com/Linuxfabrik/monitoring-plugins/releases).
- I agree to follow Monitoring Plugins's Code of Conduct.
Which variant of the Monitoring Plugins do you use?
- .rpm/.deb package from repo.linuxfabrik.ch
- Compiled for Windows from download.linuxfabrik.ch
- Source Code from GitHub
Bug description
The service.exe plugin for Windows fails to monitor services whose technical Service Name contains spaces.
This affects services like those installed by Parallels RAS, where the technical name (Win32_Service.Name) is "RAS Telegraf" — with a space. The plugin fails to match this service name, even when using quotes or regex syntax.
Expected: The plugin should support service names with whitespace (which are valid on Windows).
Actual: The plugin throws an error indicating that the service name was not found.
Steps to reproduce - Plugin call
service.exe --service="RAS Telegraf"
Steps to reproduce - Data
PS C:> Get-WmiObject Win32_Service | Where-Object { $_.DisplayName -like "RAS Telegraf" } | Select-Object Name, DisplayName
Name DisplayName
RAS Telegraf RAS Telegraf
Plugin output:
rRAS Telegraf does not match any service name.
Tried also:
service.exe --service="^RAS Telegraf$"
service.exe --service=".*Telegraf"
Environment
Windows Server 2022
Parallels RAS 19.x
Icinga2 Agent on Windows
Plugin binary: service.exe (from Linuxfabrik monitoring plugin package)
Plugin Version
service.exe: v2025021501 by Linuxfabrik GmbH, Zurich/Switzerland
Python version
No response
List of Python modules
No response
Additional Information
The plugin likely uses psutil.win_service_get(name), which is strict and fails on whitespace-containing service names.
Suggested fix:
Iterate all services using psutil.win_service_iter() and match manually, e.g.:
services = [s.as_dict() for s in psutil.win_service_iter()]
service = next((s for s in services if s['name'].lower() == service_name.lower()), None)
Additionally, consider allowing regex or fallback to DisplayName matching for flexibility.
This issue affects any service where Win32_Service.Name contains spaces — which is rare but valid on Windows.