Python Check_command on Windows Host failed to execute

Hi…

we need to develop a check_Command to monitor an audio streaming device. This needs to be done using python and the python script needs to be run on a Windows machine.

The machine is a W2019 Server and has an Icinga Agent installed.

Additionally, we installed python for all users and the needed modules with pip.

We created the check_streams.py script and put it in the C:\Program Files\ICINGA2\sbin folder.

we can run the script from the commandline on the machine itself with the expected result

In Icinga Director I created a Plugin Check Command object and set the command to check_streams.py

I created the necessary Service and Service apply rules and rolled out the config…

The check is executed but the Check output is:

Command “C:\Program Files\ICINGA2\/sbin/check_streams.py” failed to execute: 193, “%1 ist keine zul�ssige Win32-Anwendung.”

Even if I run “C:\Program Files\ICINGA2\/sbin/check_streams.py”

Any ideas?

I already check the solutions from Python Skript on Windows Server doesent Work via Icinga

and

but I couldn’t solve this …

The Icinga Agent Version is 2.11.6

Python is 3.14…

Best

Benedikt

Thanks for posting.

Please show us your generated check command. Based on the error, I would guess the CheckCommand.command is exactly the path to the Python script, which is not an Windows binary, but plain text.

Try setting your command to something like /path/to/python3 /path/to/check_streams.py (adjust paths).

Unrelated to the question, but I hope this is a typo. Otherwise, you would run a very outdated agent with multiple critical security vulnerabilities.

1 Like

After I moved everything (Python.exe and our python script) to folders without any Blank in the name, it works…

'C:\Python\Python314\Python.exe' 'C:\Tools\sbin\check_streams.py'

By the way…This machine was a forgotten one in our test area, we updated the Icinga Agent in the meantime…. :slight_smile:

Thank you for your thoughts

1 Like