From cf99d54870da341c1b7b3af58f102e26c16ce379 Mon Sep 17 00:00:00 2001 From: Christian Breunig Date: Tue, 4 Mar 2025 13:47:30 +0100 Subject: syslog: T6989: add option do disable "MARK" New CLI command set system syslog marker disable --- data/templates/rsyslog/rsyslog.conf.j2 | 2 +- interface-definitions/system_syslog.xml.in | 1 + smoketest/scripts/cli/test_system_syslog.py | 6 ++++++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/data/templates/rsyslog/rsyslog.conf.j2 b/data/templates/rsyslog/rsyslog.conf.j2 index c6eb6430c..e2ff334ff 100644 --- a/data/templates/rsyslog/rsyslog.conf.j2 +++ b/data/templates/rsyslog/rsyslog.conf.j2 @@ -40,7 +40,7 @@ global(workDirectory="/var/spool/rsyslog") # Send emergency messages to all logged-in users *.emerg action(type="omusrmsg" users="*") -{% if marker is vyos_defined %} +{% if marker is vyos_defined and marker.disable is not vyos_defined %} # Load the immark module for periodic --MARK-- message capability module(load="immark" interval="{{ marker.interval }}") {% endif %} diff --git a/interface-definitions/system_syslog.xml.in b/interface-definitions/system_syslog.xml.in index 32dcf65ff..8b2d9cab7 100644 --- a/interface-definitions/system_syslog.xml.in +++ b/interface-definitions/system_syslog.xml.in @@ -80,6 +80,7 @@ Mark messages sent to syslog + #include Mark message interval diff --git a/smoketest/scripts/cli/test_system_syslog.py b/smoketest/scripts/cli/test_system_syslog.py index c3b14e1c0..e642b5660 100755 --- a/smoketest/scripts/cli/test_system_syslog.py +++ b/smoketest/scripts/cli/test_system_syslog.py @@ -120,6 +120,12 @@ class TestRSYSLOGService(VyOSUnitTestSHIM.TestCase): self.assertIn( ' rotation.sizeLimit="524288"', config) self.assertIn( ' rotation.sizeLimitCommand="/usr/sbin/logrotate /etc/logrotate.d/vyos-rsyslog"', config) + self.cli_set(base_path + ['marker', 'disable']) + self.cli_commit() + + config = get_config('') + self.assertNotIn('module(load="immark"', config) + def test_remote(self): rhosts = { '169.254.0.1': { -- cgit v1.2.3