CMK version: 2.3.0p34 OS version: virt1 - Version: 1.7.10 Host OS: Windows Server 2019 Datacenter - Agent 2.3.0p34
I encountered this error while running cmk-agent-ctl.exe dump.
Although the error is shown in the dump, the Windows Task is listed as a service.
It appears that Checkmk is processing the information correctly, but the agent cannot create the output for the CLI. To my knowledge, all the tested umlauts should be included in UTF-8.
After creating another task, the output appears to stop at the umlaut.
The second task does not appear in the dump but shows up in the discovered services.
Way to reproduce this:
Enable Windows Task Plugin
Create task containing umlauts
run cmk-agent-ctl.exe dump
Create another task containing umlauts
run cmk-agent-ctl.exe dump again(same output as in step 3)
Error message:
<<<windows_tasks:sep(58):encoding(cp437):cached(1753185991,120)>>>
TaskName : \Datenexport f[2025-07-22 14:08:06.088162 +02:00] ERROR [cmk_agent_ctl] src/main.rs:29: Error writing monitoring data to stdout.
Caused by:
Windows stdio in console mode does not support writing non-UTF-8 byte sequences
Output of “cmk --debug -vvn hostname”:
Includes a lot of sensitive information. If it’s absolutely necessary, I can share a shortened version.
Windows uses UTF-16 as default in most cases. Here character encodings get converted back and forth I will create a bug ticket for this. But that will be low priority, I assume…
Thanks for reporting!
As a workaround please dump to a (binary) file and open with a UTF-8 aware editor.
Here is my version of the “windows_tasks.ps1”. It has three columns more but these can easily removed from the output line. More important is in the header the [Console]::OutputEncoding = [System.Text.UTF8Encoding]::new($true).
With this you get real UTF8 output without any conversation.
At the moment i don’t want to port this version of the tasks check for 2.4 as the shadowing of included files is a real pain.
But if i see more problems like the mentioned umlaut problems i probably would also do this mkp for 2.4.
PS: if i look at the code of windows_tasks.ps1 then i think it is a real joke at the moment
Can I just edit/replace the stock version in ~/share/check_mk/agents/windows/plugins ?
I don´t want to change the file on the agent itself as we use the bakery and automatic updates.
Does this in any way break the update mechanism if the fix is implemented in a future version?
As it is not so easy with only replacing the file, i wrote that i must consider to make a new mkp for 2.4.
My script uses also a little bit different output as the original and had also a check plugin with more functionality.