Branch: refs/heads/master
Home:
https://github.com/tribe29/checkmk
Commit: 7d2734915c17fdad73f1cd6ee1e9b588c45eac43
https://github.com/tribe29/checkmk/commit/7d2734915c17fdad73f1cd6ee1e9b588c…
Author: Lars Michelsen <lm(a)tribe29.com>
Date: 2019-12-03 (Tue, 03 Dec 2019)
Changed paths:
A .werks/10563
M agents/check_mk_agent.linux
Log Message:
-----------
10563 FIX Linux agent: Fix possible encoding issues of Python plugins
In previous versions the agent was not setting the encoding information in the
environment, making Python plugins fail with <tt>UnicodeEncodeError</tt>
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 <tt>LC_ALL</tt> to C.utf8 (in case the locale
is
available on the monitored system) instead of only <tt>LC_ALL=C</tt>.
When the encoding is not set in the environment, Python will encode all the output
written to stdout/stderr with <tt>ANSI_X3.4-1968</tt>. 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.
CMK-2778
Change-Id: I015b3e9824da1cec72cb3290120bb0493761df2a