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

Komponente Checks und Agenten
Titel Linux agent: Fix possible encoding issues of Python plugins
Datum 02.12.2019
Checkmk-Editon Checkmk Raw (CRE)
Checkmk-Version 2.0.0i1
Level Kleine Änderung
Klasse Bugfix
Kompatibilität Kompatibel - benötigt kein manuelles Eingreifen

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.

Zur Liste aller Werks