diff options
author | Christian Breunig <christian@breunig.cc> | 2025-03-04 13:47:30 +0100 |
---|---|---|
committer | Christian Breunig <christian@breunig.cc> | 2025-03-04 14:05:36 +0100 |
commit | cf99d54870da341c1b7b3af58f102e26c16ce379 (patch) | |
tree | 6234b6c47e38fca9d7e7c20a4f32af2bb4395bc2 | |
parent | 3500e743ad608a8aecc1cf9004f1792e4f74729c (diff) | |
download | vyos-1x-cf99d54870da341c1b7b3af58f102e26c16ce379.tar.gz vyos-1x-cf99d54870da341c1b7b3af58f102e26c16ce379.zip |
syslog: T6989: add option do disable "MARK"syslog-typos-T6989
New CLI command
set system syslog marker disable
-rw-r--r-- | data/templates/rsyslog/rsyslog.conf.j2 | 2 | ||||
-rw-r--r-- | interface-definitions/system_syslog.xml.in | 1 | ||||
-rwxr-xr-x | smoketest/scripts/cli/test_system_syslog.py | 6 |
3 files changed, 8 insertions, 1 deletions
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 @@ <help>Mark messages sent to syslog</help> </properties> <children> + #include <include/generic-disable-node.xml.i> <leafNode name="interval"> <properties> <help>Mark message interval</help> 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': { |