From ead2e596726539724526ebb1dc8334c1aa6c221a Mon Sep 17 00:00:00 2001 From: hagbard Date: Thu, 7 Mar 2019 13:07:52 -0800 Subject: [rsyslog] T1282 - Configure VyOS to send syslog messages to remote syslog using fully-qualified domain name --- src/conf_mode/syslog.py | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/conf_mode/syslog.py b/src/conf_mode/syslog.py index f8f8d9457..e726a5755 100755 --- a/src/conf_mode/syslog.py +++ b/src/conf_mode/syslog.py @@ -30,12 +30,15 @@ from vyos import ConfigError configs = ''' ## generated by syslog.py ## ## file based logging -{% if files['global']['marker'] %} +{% if files['global']['marker'] -%} $ModLoad immark {% if files['global']['marker-interval'] %} $MarkMessagePeriod {{files['global']['marker-interval']}} {% endif %} -{% endif %} +{% endif -%} +{% if files['global']['preserver_fqdn'] -%} +$PreserveFQDN on +{% endif -%} {% for file in files %} $outchannel {{file}},{{files[file]['log-file']}},{{files[file]['max-size']}},{{files[file]['action-on-max-size']}} {{files[file]['selectors']}} :omfile:${{file}} @@ -99,11 +102,12 @@ def get_config(): config_data['files'].update( { 'global' : { - 'log-file' : '/var/log/messages', - 'max-size' : 262144, + 'log-file' : '/var/log/messages', + 'max-size' : 262144, 'action-on-max-size' : '/usr/sbin/logrotate /etc/logrotate.d/vyos-rsyslog', - 'selectors' : '*.notice;local7.debug', - 'max-files' : '5' + 'selectors' : '*.notice;local7.debug', + 'max-files' : '5', + 'preserver_fqdn' : False } } ) @@ -118,6 +122,9 @@ def get_config(): config_data['files']['global']['max-size'] = int(c.return_value('global archive size'))* 1024 if c.exists('global archive files'): config_data['files']['global']['max-files'] = c.return_value('global archive files') + if c.exists('global preserve-fqdn'): + config_data['files']['global']['preserver_fqdn'] = True + ### # set system syslog file ### -- cgit v1.2.3