From 2ce259ef27c2256d1366175c095bb45d0ef67655 Mon Sep 17 00:00:00 2001 From: Simon Harms <10880193+Simon0Harms@users.noreply.github.com> Date: Tue, 14 Jul 2026 19:34:01 +0200 Subject: [PATCH] mk_sap: apply host_prefix to logwatch piggyback header MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The host_prefix config option in mk_sap is currently only applied to the SAP value section header, but not to the logwatch section header. As a result, the two sections end up on different piggyback hosts when host_prefix is set. Where In check(), the SAP data block writes the header as: "<<<<%s%s>>>>\n" % (cfg_entry.get("host_prefix", ""), host) while the logwatch block writes: "<<<<%s>>>>\n" % host — dropping the prefix. --- cmk/plugins/sap/agents/mk_sap.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmk/plugins/sap/agents/mk_sap.py b/cmk/plugins/sap/agents/mk_sap.py index 54976fdd344..cd0708be89e 100755 --- a/cmk/plugins/sap/agents/mk_sap.py +++ b/cmk/plugins/sap/agents/mk_sap.py @@ -504,7 +504,7 @@ def check(pyrfc, cfg_entry): sys.stdout.write("<<<<>>>>\n") for host, host_logs in logs.items(): - sys.stdout.write("<<<<%s>>>>\n" % host) + sys.stdout.write("<<<<%s%s>>>>\n" % (cfg_entry.get("host_prefix", ""), host)) sys.stdout.write("<<>>\n") for log, lines in host_logs.items(): sys.stdout.write("[[[%s]]]\n" % log)