X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;f=templates%2Fsyslog-ng.conf.erb;h=f60820d03758666d7e30540b1a8365a592e3eba3;hb=4e7d390149e7447262d4711e087880dbc5306abb;hp=abe8fe5b1524fe01262264830427175d8a2b83f0;hpb=58403c9e36e656b9e17ac1f43f93b280316a3e98;p=mirror%2Fdsa-puppet.git diff --git a/templates/syslog-ng.conf.erb b/templates/syslog-ng.conf.erb index abe8fe5b1..f60820d03 100644 --- a/templates/syslog-ng.conf.erb +++ b/templates/syslog-ng.conf.erb @@ -1,4 +1,4 @@ -<%- if syslogversion == "3" -%> +<%- if has_variable?("syslogversion") and syslogversion.to_s == "3" -%> @version: 3.0 <%- end -%> ## @@ -94,7 +94,7 @@ options { # sources # all known message sources -source a_local { +source s_local { # message generated by Syslog-NG internal(); <%- if kernel == 'Linux' -%> @@ -102,7 +102,7 @@ source a_local { # function to send logs to) unix-stream("/dev/log"); # messages from the kernel -<%- if syslogversion == "2" -%> +<%- if has_variable?("syslogversion") and syslogversion.to_s == "2" -%> file("/proc/kmsg" log_prefix("kernel: ")); <%- else -%> file("/proc/kmsg" program_override("kernel: ")); @@ -112,7 +112,7 @@ source a_local { # function to send logs to) unix-dgram("/var/run/log"); # messages from the kernel -<%- if syslogversion == "2" -%> +<%- if has_variable?("syslogversion") and syslogversion.to_s == "2" -%> file("/dev/klog" log_prefix("kernel: ")); <%- else -%> file("/dev/klog" program_override("kernel: ")); @@ -191,7 +191,7 @@ destination du_all { usertty("*"); }; filter f_auth { facility(auth, authpriv); }; # all messages except from the auth and authpriv facilities -filter f_syslog { not facility(auth, authpriv); }; +filter f_syslog { not facility(auth, authpriv, mail); }; # respectively: messages from the cron, daemon, kern, lpr, mail, news, user, # and uucp facilities @@ -251,14 +251,14 @@ filter f_xconsole { # auth,authpriv.* /var/log/auth.log log { - source(a_local); + source(s_local); filter(f_auth); destination(df_auth); }; # *.*;auth,authpriv.none -/var/log/syslog log { - source(a_local); + source(s_local); filter(f_syslog); destination(df_syslog); }; @@ -266,56 +266,56 @@ log { # this is commented out in the default syslog.conf # cron.* /var/log/cron.log #log { -# source(a_local); +# source(s_local); # filter(f_cron); # destination(df_cron); #}; # daemon.* -/var/log/daemon.log log { - source(a_local); + source(s_local); filter(f_daemon); destination(df_daemon); }; # kern.* -/var/log/kern.log log { - source(a_local); + source(s_local); filter(f_kern); destination(df_kern); }; # lpr.* -/var/log/lpr.log log { - source(a_local); + source(s_local); filter(f_lpr); destination(df_lpr); }; # mail.* -/var/log/mail.log log { - source(a_local); + source(s_local); filter(f_mail); destination(df_mail); }; # user.* -/var/log/user.log log { - source(a_local); + source(s_local); filter(f_user); destination(df_user); }; # uucp.* /var/log/uucp.log log { - source(a_local); + source(s_local); filter(f_uucp); destination(df_uucp); }; # mail.info -/var/log/mail.info log { - source(a_local); + source(s_local); filter(f_mail); filter(f_at_least_info); destination(df_mail_info); @@ -323,7 +323,7 @@ log { # mail.warn -/var/log/mail.warn log { - source(a_local); + source(s_local); filter(f_mail); filter(f_at_least_warn); destination(df_mail_warn); @@ -331,7 +331,7 @@ log { # mail.err /var/log/mail.err log { - source(a_local); + source(s_local); filter(f_mail); filter(f_at_least_err); destination(df_mail_err); @@ -339,7 +339,7 @@ log { # news.crit /var/log/news/news.crit log { - source(a_local); + source(s_local); filter(f_news); filter(f_at_least_crit); destination(df_news_dot_crit); @@ -347,7 +347,7 @@ log { # news.err /var/log/news/news.err log { - source(a_local); + source(s_local); filter(f_news); filter(f_at_least_err); destination(df_news_dot_err); @@ -355,7 +355,7 @@ log { # news.notice /var/log/news/news.notice log { - source(a_local); + source(s_local); filter(f_news); filter(f_at_least_notice); destination(df_news_dot_notice); @@ -366,7 +366,7 @@ log { # auth,authpriv.none;\ # news.none;mail.none -/var/log/debug log { - source(a_local); + source(s_local); filter(f_debug); destination(df_debug); }; @@ -377,14 +377,14 @@ log { # cron,daemon.none;\ # mail,news.none -/var/log/messages log { - source(a_local); + source(s_local); filter(f_messages); destination(df_messages); }; # *.emerg * log { - source(a_local); + source(s_local); filter(f_emerg); destination(du_all); }; @@ -396,7 +396,7 @@ log { # *.=debug;*.=info;\ # *.=notice;*.=warn |/dev/xconsole log { - source(a_local); + source(s_local); filter(f_xconsole); destination(dp_xconsole); }; @@ -404,7 +404,7 @@ log { <%- if hostname != "heininen" -%> - <%- if syslogversion == "3" -%> + <%- if has_variable?("syslogversion") and syslogversion.to_s == "3" -%> destination loghost-heininen { tcp("heininen.debian.org" port (5140) tls( key_file("/etc/ssl/debian/keys/thishost.key") @@ -416,7 +416,7 @@ destination loghost-heininen { log { - source(a_local); + source(s_local); destination(loghost-heininen); }; <%- end -%> @@ -433,50 +433,51 @@ log { # The log server, additionally, also logs all local and remote messages to # a few special places. destination hostdest_auth { file("/var/log/hosts/$HOST/$YEAR/$MONTH/$DAY/auth.log" - owner(root) group(adm) perm(0640) dir_perm(0750) create_dirs(yes) dir_owner(root) dir_group(adm)); }; + owner(root) group(adm) perm(0640) dir_perm(0755) create_dirs(yes) dir_owner(root) dir_group(adm)); }; destination hostdest_syslog { file("/var/log/hosts/$HOST/$YEAR/$MONTH/$DAY/syslog" - owner(root) group(adm) perm(0640) dir_perm(0750) create_dirs(yes) dir_owner(root) dir_group(adm)); }; + owner(root) group(adm) perm(0640) dir_perm(0755) create_dirs(yes) dir_owner(root) dir_group(adm)); }; destination hostdest_cron { file("/var/log/hosts/$HOST/$YEAR/$MONTH/$DAY/cron.log" - owner(root) group(adm) perm(0640) dir_perm(0750) create_dirs(yes) dir_owner(root) dir_group(adm)); }; + owner(root) group(adm) perm(0640) dir_perm(0755) create_dirs(yes) dir_owner(root) dir_group(adm)); }; destination hostdest_daemon { file("/var/log/hosts/$HOST/$YEAR/$MONTH/$DAY/daemon.log" - owner(root) group(adm) perm(0640) dir_perm(0750) create_dirs(yes) dir_owner(root) dir_group(adm)); }; + owner(root) group(adm) perm(0640) dir_perm(0755) create_dirs(yes) dir_owner(root) dir_group(adm)); }; destination hostdest_kern { file("/var/log/hosts/$HOST/$YEAR/$MONTH/$DAY/kern.log" - owner(root) group(adm) perm(0640) dir_perm(0750) create_dirs(yes) dir_owner(root) dir_group(adm)); }; + owner(root) group(adm) perm(0640) dir_perm(0755) create_dirs(yes) dir_owner(root) dir_group(adm)); }; destination hostdest_lpr { file("/var/log/hosts/$HOST/$YEAR/$MONTH/$DAY/lpr.log" - owner(root) group(adm) perm(0640) dir_perm(0750) create_dirs(yes) dir_owner(root) dir_group(adm)); }; + owner(root) group(adm) perm(0640) dir_perm(0755) create_dirs(yes) dir_owner(root) dir_group(adm)); }; destination hostdest_mail { file("/var/log/hosts/$HOST/$YEAR/$MONTH/$DAY/mail.log" - owner(root) group(adm) perm(0640) dir_perm(0750) create_dirs(yes) dir_owner(root) dir_group(adm)); }; + owner(root) group(adm) perm(0640) dir_perm(0755) create_dirs(yes) dir_owner(root) dir_group(adm)); }; destination hostdest_news { file("/var/log/hosts/$HOST/$YEAR/$MONTH/$DAY/news.log" - owner(root) group(adm) perm(0640) dir_perm(0750) create_dirs(yes) dir_owner(root) dir_group(adm)); }; + owner(root) group(adm) perm(0640) dir_perm(0755) create_dirs(yes) dir_owner(root) dir_group(adm)); }; destination hostdest_user { file("/var/log/hosts/$HOST/$YEAR/$MONTH/$DAY/user.log" - owner(root) group(adm) perm(0640) dir_perm(0750) create_dirs(yes) dir_owner(root) dir_group(adm)); }; + owner(root) group(adm) perm(0640) dir_perm(0755) create_dirs(yes) dir_owner(root) dir_group(adm)); }; destination hostdest_uucp { file("/var/log/hosts/$HOST/$YEAR/$MONTH/$DAY/uucp.log" - owner(root) group(adm) perm(0640) dir_perm(0750) create_dirs(yes) dir_owner(root) dir_group(adm)); }; + owner(root) group(adm) perm(0640) dir_perm(0755) create_dirs(yes) dir_owner(root) dir_group(adm)); }; destination hostdest_debug { file("/var/log/hosts/$HOST/$YEAR/$MONTH/$DAY/debug" - owner(root) group(adm) perm(0640) dir_perm(0750) create_dirs(yes) dir_owner(root) dir_group(adm)); }; + owner(root) group(adm) perm(0640) dir_perm(0755) create_dirs(yes) dir_owner(root) dir_group(adm)); }; destination hostdest_messages { file("/var/log/hosts/$HOST/$YEAR/$MONTH/$DAY/messages" - owner(root) group(adm) perm(0640) dir_perm(0750) create_dirs(yes) dir_owner(root) dir_group(adm)); }; + owner(root) group(adm) perm(0640) dir_perm(0755) create_dirs(yes) dir_owner(root) dir_group(adm)); }; #---------------------------------------------------------------------- # Special catch all destination hostdest_sorting by host #---------------------------------------------------------------------- destination hostdest_facility_dot_info { file("/var/log/hosts/$HOST/$YEAR/$MONTH/$DAY/$FACILITY.info" - owner(root) group(adm) perm(0640) dir_perm(0750) create_dirs(yes) dir_owner(root) dir_group(adm)); }; + owner(root) group(adm) perm(0640) dir_perm(0755) create_dirs(yes) dir_owner(root) dir_group(adm)); }; destination hostdest_facility_dot_notice { file("/var/log/hosts/$HOST/$YEAR/$MONTH/$DAY/$FACILITY.notice" - owner(root) group(adm) perm(0640) dir_perm(0750) create_dirs(yes) dir_owner(root) dir_group(adm)); }; + owner(root) group(adm) perm(0640) dir_perm(0755) create_dirs(yes) dir_owner(root) dir_group(adm)); }; destination hostdest_facility_dot_warn { file("/var/log/hosts/$HOST/$YEAR/$MONTH/$DAY/$FACILITY.warn" - owner(root) group(adm) perm(0640) dir_perm(0750) create_dirs(yes) dir_owner(root) dir_group(adm)); }; + owner(root) group(adm) perm(0640) dir_perm(0755) create_dirs(yes) dir_owner(root) dir_group(adm)); }; destination hostdest_facility_dot_err { file("/var/log/hosts/$HOST/$YEAR/$MONTH/$DAY/$FACILITY.err" - owner(root) group(adm) perm(0640) dir_perm(0750) create_dirs(yes) dir_owner(root) dir_group(adm)); }; + owner(root) group(adm) perm(0640) dir_perm(0755) create_dirs(yes) dir_owner(root) dir_group(adm)); }; destination hostdest_facility_dot_crit { file("/var/log/hosts/$HOST/$YEAR/$MONTH/$DAY/$FACILITY.crit" - owner(root) group(adm) perm(0640) dir_perm(0750) create_dirs(yes) dir_owner(root) dir_group(adm)); }; + owner(root) group(adm) perm(0640) dir_perm(0755) create_dirs(yes) dir_owner(root) dir_group(adm)); }; #---------------------------------------------------------------------- # Catch all log files #---------------------------------------------------------------------- destination df_ALL_auth { file("/var/log/auth-all.log"); }; +destination df_ALL_mail { file("/var/log/mail-all.log"); }; destination df_ALL_syslog { file("/var/log/syslog-all"); }; log { source(s_local); @@ -528,6 +529,9 @@ log { source(s_local); log { source(s_local); source(s_network); filter(f_auth); destination(df_ALL_auth); }; +log { source(s_local); + source(s_network); + filter(f_mail); destination(df_ALL_mail); }; log { source(s_local); source(s_network); filter(f_syslog); destination(df_ALL_syslog); };