We use cookies to ensure that we give you the best experience on our website.  Visit our Privacy Policy to learn more. If you continue to use this site, we will assume that you are okay with it.

Your choices regarding cookies on this site.
Your preferences have been updated.
In order for the changes to take effect completely please clear your browser cookies and cache. Then reload the page.

Werk #10563: Linux agent: Fix possible encoding issues of Python plugins

ComponentChecks & Agents
TitleLinux agent: Fix possible encoding issues of Python plugins
Date2019-12-02 09:32:35
Checkmk EditionCheckmk Raw Edition (CRE)
Checkmk Version2.0.0i1
LevelTrivial Change
ClassBug Fix
CompatibilityCompatible - no manual interaction needed

In previous versions the agent was not setting the encoding information in the environment, making Python plugins fail with UnicodeEncodeError exceptions when executed through the agent.

Confusingly, the same command has often worked in interactive debugging, since the interactive shells of the users have set the encoding correctly

The Linux agent is now setting LC_ALL to C.utf8 (in case the locale is available on the monitored system) instead of only LC_ALL=C.

When the encoding is not set in the environment, Python will encode all the output written to stdout/stderr with ANSI_X3.4-1968. This will fail when there are non-ASCII characters in the output. Once the encoding is set, Python can detect it and encode all output using UTF-8.