Werk #17088: mk_logwatch: Remove colored output support in debug mode

Komponente Checks & agents
Titel mk_logwatch: Remove colored output support in debug mode
Datum 23.09.2024
Level Kleine Änderung
Klasse Bugfix
Kompatibilität Inkompatibel - Manuelle Interaktion könnte erforderlich sein
Checkmk versions & editions
2.4.0b1 Checkmk Raw (CRE), Checkmk Enterprise (CEE), Checkmk Cloud (CCE), Checkmk MSP (CME)
2.3.0p18 Checkmk Raw (CRE), Checkmk Enterprise (CEE), Checkmk Cloud (CCE), Checkmk MSP (CME)
2.2.0p35 Checkmk Raw (CRE), Checkmk Enterprise (CEE), Checkmk Cloud (CCE), Checkmk MSP (CME)

Until now the debug mode ("-d" flag) would color the lines of the mk_logwatch output depending on their log level. This causes problems when processing the output, leading to the e.g. maxcontextlines setting no longer being effective. To improve the stability of the agent plugin, its output will no longer be colored. If you need the output to be colored, you can do so via e.g.

mk_logwatch.py -d  | sed  -e 's/^C .*/\x1b[1;31m&\x1b[0m/' -e 's/^W .*/\x1b[1;33m&\x1b[0m/' -e 's/^O .*/\x1b[1;32m&\x1b[0m/' -e 's/^I .*/\x1b[1;34m&\x1b[0m/'

Zur Liste aller Werks