]> git.donarmstrong.com Git - dsa-puppet.git/blob - modules/syslog-ng/templates/syslog-ng.conf.erb
new loghost loghost-grnet-01
[dsa-puppet.git] / modules / syslog-ng / templates / syslog-ng.conf.erb
1 <%- if has_variable?("syslogversion") and syslogversion.to_s == "3.1" -%>
2 @version: 3.0
3 <%- else -%>
4 @version: 3.3
5 <%- end -%>
6 ##
7 ## THIS FILE IS UNDER PUPPET CONTROL. DON'T EDIT IT HERE.
8 ## USE: git clone git+ssh://$USER@puppet.debian.org/srv/puppet.debian.org/git/dsa-puppet.git
9 ##
10
11 #
12 # Configuration file for syslog-ng under Debian
13 #
14 # attempts at reproducing default syslog behavior
15
16 # the standard syslog levels are (in descending order of priority):
17 # emerg alert crit err warning notice info debug
18 # the aliases "error", "panic", and "warn" are deprecated
19 # the "none" priority found in the original syslogd configuration is
20 # only used in internal messages created by syslogd
21
22
23 ######
24 # options
25
26 options {
27         # disable the chained hostname format in logs
28         # (default is enabled)
29         chain_hostnames(1);
30
31         # the time to wait before a died connection is re-established
32         # (default is 60)
33         time_reopen(10);
34
35         # the time to wait before an idle destination file is closed
36         # (default is 60)
37         time_reap(360);
38
39         # the number of lines buffered before written to file
40         # you might want to increase this if your disk isn't catching with
41         # all the log messages you get or if you want less disk activity
42         # (say on a laptop)
43         # (default is 0)
44         #sync(0);
45
46         # the number of lines fitting in the output queue
47 <%- if has_variable?("syslogversion") and syslogversion.to_s == "3.1" -%>
48         log_fifo_size(2048);
49 <%- else -%>
50         log_fifo_size(10000);
51 <%- end -%>
52
53         # enable or disable directory creation for destination files
54         create_dirs(yes);
55
56         # default owner, group, and permissions for log files
57         # (defaults are 0, 0, 0600)
58         #owner(root);
59         group(adm);
60         perm(0640);
61
62         # default owner, group, and permissions for created directories
63         # (defaults are 0, 0, 0700)
64         #dir_owner(root);
65         #dir_group(root);
66         dir_perm(0755);
67
68         # enable or disable DNS usage
69         # syslog-ng blocks on DNS queries, so enabling DNS may lead to
70         # a Denial of Service attack
71         # (default is yes)
72         use_dns(no);
73
74         # maximum length of message in bytes
75         # this is only limited by the program listening on the /dev/log Unix
76         # socket, glibc can handle arbitrary length log messages, but -- for
77         # example -- syslogd accepts only 1024 bytes
78         # (default is 2048)
79         #log_msg_size(2048);
80
81         #Disable statistic log messages.
82         stats_freq(0);
83
84         # Some program send log messages through a private implementation.
85         # and sometimes that implementation is bad. If this happen syslog-ng
86         # may recognise the program name as hostname. Whit this option
87         # we tell the syslog-ng that if a hostname match this regexp than that
88         # is not a real hostname.
89         bad_hostname("^gconfd$");
90
91         keep_hostname(no);
92
93         # We believe our own clock more than we believe the client clock.
94         keep_timestamp(no);
95 };
96
97
98 ######
99 # sources
100
101 # all known message sources
102 source s_local {
103         # message generated by Syslog-NG
104         internal();
105 <%- if kernel == 'Linux' -%>
106         # standard Linux log source (this is the default place for the syslog()
107         # function to send logs to)
108         unix-stream("/dev/log");
109         # messages from the kernel
110         file("/proc/kmsg" program_override("kernel: "));
111 <%- else -%>
112         # standard Linux log source (this is the default place for the syslog()
113         # function to send logs to)
114         unix-dgram("/var/run/log");
115         # messages from the kernel
116         file("/dev/klog" program_override("kernel: ") follow-freq(1));
117 <%- end -%>
118 };
119
120 <%- if (hostname == "lotti") || (hostname == "lully") || (hostname == "loghost-grnet-01") -%>
121 source s_network {
122         tcp6(port(5140) max-connections(200)
123                 tls( key_file("/etc/exim4/ssl/thishost.key")
124                      cert_file("/etc/exim4/ssl/thishost.crt")
125                      ca_dir("/etc/exim4/ssl/")
126                 )
127         );
128 };
129 <%- end -%>
130
131
132 ######
133 # destinations
134
135 # some standard log files
136 destination df_auth { file("/var/log/auth.log"); };
137 destination df_syslog { file("/var/log/syslog"); };
138 destination df_cron { file("/var/log/cron.log"); };
139 destination df_daemon { file("/var/log/daemon.log"); };
140 destination df_kern { file("/var/log/kern.log"); };
141 destination df_lpr { file("/var/log/lpr.log"); };
142 destination df_mail { file("/var/log/mail.log" group(maillog)); };
143 # destination df_mail_info { file("/var/log/mail.info" group(maillog)); };
144 destination df_mail_warn { file("/var/log/mail.warn" group(maillog)); };
145 destination df_mail_err { file("/var/log/mail.err" group(maillog)); };
146 destination df_user { file("/var/log/user.log" perm(0644)); };
147 destination df_uucp { file("/var/log/uucp.log"); };
148
149 # these files are meant for the mail system log files
150 # and provide re-usable destinations for {mail,cron,...}.info,
151 # {mail,cron,...}.notice, etc.
152 destination df_facility_dot_info { file("/var/log/$FACILITY.info"); };
153 destination df_facility_dot_notice { file("/var/log/$FACILITY.notice"); };
154 destination df_facility_dot_warn { file("/var/log/$FACILITY.warn"); };
155 destination df_facility_dot_err { file("/var/log/$FACILITY.err"); };
156 destination df_facility_dot_crit { file("/var/log/$FACILITY.crit"); };
157
158 # these files are meant for the news system, and are kept separated
159 # because they should be owned by "news" instead of "root"
160 destination df_news_dot_notice { file("/var/log/news/news.notice" owner("news")); };
161 destination df_news_dot_err { file("/var/log/news/news.err" owner("news")); };
162 destination df_news_dot_crit { file("/var/log/news/news.crit" owner("news")); };
163
164 # some more classical and useful files found in standard syslog configurations
165 destination df_debug { file("/var/log/debug"); };
166 destination df_messages { file("/var/log/messages"); };
167
168 <%- if kernel == 'Linux' -%>
169 # pipes
170 # a console to view log messages under X
171 destination dp_xconsole { pipe("/dev/xconsole"); };
172
173 <%- end -%>
174 # consoles
175 # this will send messages to everyone logged in
176 destination du_all { usertty("*"); };
177
178
179 ######
180 # filters
181
182 # all messages from the auth and authpriv facilities
183 filter f_auth { facility(auth, authpriv); };
184
185 # all messages except from the auth and authpriv facilities
186 filter f_syslog { not facility(auth, authpriv, mail); };
187
188 # respectively: messages from the cron, daemon, kern, lpr, mail, news, user,
189 # and uucp facilities
190 filter f_cron { facility(cron); };
191 filter f_daemon { facility(daemon); };
192 filter f_kern { facility(kern); };
193 filter f_lpr { facility(lpr); };
194 filter f_mail { facility(mail); };
195 filter f_news { facility(news); };
196 filter f_user { facility(user); };
197 filter f_uucp { facility(uucp); };
198
199 # some filters to select messages of priority greater or equal to info, warn,
200 # and err
201 # (equivalents of syslogd's *.info, *.warn, and *.err)
202 filter f_at_least_info { level(info..emerg); };
203 filter f_at_least_notice { level(notice..emerg); };
204 filter f_at_least_warn { level(warn..emerg); };
205 filter f_at_least_err { level(err..emerg); };
206 filter f_at_least_crit { level(crit..emerg); };
207
208 # all messages of priority debug not coming from the auth, authpriv, news, and
209 # mail facilities
210 filter f_debug { level(debug) and not facility(auth, authpriv, news, mail); };
211
212 # all messages of info, notice, or warn priority not coming form the auth,
213 # authpriv, cron, daemon, mail, and news facilities
214 filter f_messages {
215         level(info,notice,warn)
216             and not facility(auth,authpriv,cron,daemon,mail,news);
217 };
218
219 # messages with priority emerg
220 filter f_emerg { level(emerg); };
221
222 <%- if kernel == 'Linux' -%>
223 # complex filter for messages usually sent to the xconsole
224 filter f_xconsole {
225     facility(daemon,mail)
226         or level(debug,info,notice,warn)
227         or (facility(news)
228                 and level(crit,err,notice));
229 };
230
231 <%- end -%>
232
233 # order matters if you use "flags(final);" to mark the end of processing in a
234 # "log" statement
235
236 ###############################################################################
237 ########## ON LOG CLIENTS #####################################################
238 ###############################################################################
239 ###############################################################################
240 ###############################################################################
241 # all log clients, including the log server, log their locally created
242 # messages to the standard places.
243
244 # auth,authpriv.*                 /var/log/auth.log
245 log {
246         source(s_local);
247         filter(f_auth);
248         destination(df_auth);
249 };
250
251 # *.*;auth,authpriv.none          -/var/log/syslog
252 log {
253         source(s_local);
254         filter(f_syslog);
255         destination(df_syslog);
256 };
257
258 # this is commented out in the default syslog.conf
259 # cron.*                         /var/log/cron.log
260 #log {
261 #        source(s_local);
262 #        filter(f_cron);
263 #        destination(df_cron);
264 #};
265
266 # daemon.*                        -/var/log/daemon.log
267 log {
268         source(s_local);
269         filter(f_daemon);
270         destination(df_daemon);
271 };
272
273 # kern.*                          -/var/log/kern.log
274 log {
275         source(s_local);
276         filter(f_kern);
277         destination(df_kern);
278 };
279
280 # lpr.*                           -/var/log/lpr.log
281 log {
282         source(s_local);
283         filter(f_lpr);
284         destination(df_lpr);
285 };
286
287 # mail.*                          -/var/log/mail.log
288 log {
289         source(s_local);
290         filter(f_mail);
291         destination(df_mail);
292 };
293
294 # user.*                          -/var/log/user.log
295 log {
296         source(s_local);
297         filter(f_user);
298         destination(df_user);
299 };
300
301 # uucp.*                          /var/log/uucp.log
302 log {
303         source(s_local);
304         filter(f_uucp);
305         destination(df_uucp);
306 };
307
308 # mail.info                       -/var/log/mail.info
309 #log {
310 #        source(s_local);
311 #        filter(f_mail);
312 #        filter(f_at_least_info);
313 #        destination(df_mail_info);
314 #};
315
316 # mail.warn                       -/var/log/mail.warn
317 log {
318         source(s_local);
319         filter(f_mail);
320         filter(f_at_least_warn);
321         destination(df_mail_warn);
322 };
323
324 # mail.err                        /var/log/mail.err
325 log {
326         source(s_local);
327         filter(f_mail);
328         filter(f_at_least_err);
329         destination(df_mail_err);
330 };
331
332 # news.crit                       /var/log/news/news.crit
333 log {
334         source(s_local);
335         filter(f_news);
336         filter(f_at_least_crit);
337         destination(df_news_dot_crit);
338 };
339
340 # news.err                        /var/log/news/news.err
341 log {
342         source(s_local);
343         filter(f_news);
344         filter(f_at_least_err);
345         destination(df_news_dot_err);
346 };
347
348 # news.notice                     /var/log/news/news.notice
349 log {
350         source(s_local);
351         filter(f_news);
352         filter(f_at_least_notice);
353         destination(df_news_dot_notice);
354 };
355
356
357 # *.=debug;\
358 #         auth,authpriv.none;\
359 #         news.none;mail.none     -/var/log/debug
360 log {
361         source(s_local);
362         filter(f_debug);
363         destination(df_debug);
364 };
365
366
367 # *.=info;*.=notice;*.=warn;\
368 #         auth,authpriv.none;\
369 #         cron,daemon.none;\
370 #         mail,news.none          -/var/log/messages
371 log {
372         source(s_local);
373         filter(f_messages);
374         destination(df_messages);
375 };
376
377 # *.emerg                         *
378 log {
379         source(s_local);
380         filter(f_emerg);
381         destination(du_all);
382 };
383
384
385 <%- if kernel == 'Linux' -%>
386 # daemon.*;mail.*;\
387 #         news.crit;news.err;news.notice;\
388 #         *.=debug;*.=info;\
389 #         *.=notice;*.=warn       |/dev/xconsole
390 log {
391         source(s_local);
392         filter(f_xconsole);
393         destination(dp_xconsole);
394 };
395 <%- end -%>
396
397
398  <%- if hostname != "lotti" -%>
399 destination loghost-lotti {
400         tcp("lotti.debian.org" port (5140)
401                 tls( key_file("/etc/ssl/debian/keys/thishost.key")
402                      cert_file("/etc/ssl/debian/certs/thishost.crt")
403                      ca_dir("/etc/ssl/debian/certs/")
404                 )
405         );
406 };
407  <%- end -%>
408   <%- if hostname != "lully" -%>
409 destination loghost-lully {
410         tcp("lully.debian.org" port (5140)
411                 tls( key_file("/etc/ssl/debian/keys/thishost.key")
412                      cert_file("/etc/ssl/debian/certs/thishost.crt")
413                      ca_dir("/etc/ssl/debian/certs/")
414                 )
415         );
416 };
417  <%- end -%>
418   <%- if hostname != "loghost-grnet-01" -%>
419 destination loghost-loghost-grnet-01 {
420         tcp("loghost-grnet-01.debian.org" port (5140)
421                 tls( key_file("/etc/ssl/debian/keys/thishost.key")
422                      cert_file("/etc/ssl/debian/certs/thishost.crt")
423                      ca_dir("/etc/ssl/debian/certs/")
424                 )
425         );
426 };
427  <%- end -%>
428
429 log {
430         source(s_local);
431  <%- if hostname != "lotti" -%>
432         destination(loghost-lotti);
433  <%- end -%>
434  <%- if hostname != "lully" -%>
435         destination(loghost-lully);
436  <%- end -%>
437  <%- if hostname != "loghost01-grnet-01" -%>
438         destination(loghost-loghost-grnet-01);
439  <%- end -%>
440 };
441
442
443
444 <%- if (hostname == "lotti") || (hostname == "lully") || (hostname == "loghost-grnet-01") -%>
445 ###############################################################################
446 ########## ON LOG HOST ########################################################
447 ###############################################################################
448 ###############################################################################
449 #
450 # The log server, additionally, also logs all local and remote messages to
451 # a few special places.
452 destination hostdest_auth           { file("/var/log/hosts/$HOST/$YEAR/$MONTH/$DAY/auth.log"
453                                       owner(root) group(adm) perm(0640) dir_perm(0755) create_dirs(yes) dir_owner(root) dir_group(adm)); };
454 destination hostdest_syslog         { file("/var/log/hosts/$HOST/$YEAR/$MONTH/$DAY/syslog"
455                                       owner(root) group(adm) perm(0640) dir_perm(0755) create_dirs(yes) dir_owner(root) dir_group(adm)); };
456 destination hostdest_cron           { file("/var/log/hosts/$HOST/$YEAR/$MONTH/$DAY/cron.log"
457                                       owner(root) group(adm) perm(0640) dir_perm(0755) create_dirs(yes) dir_owner(root) dir_group(adm)); };
458 destination hostdest_daemon         { file("/var/log/hosts/$HOST/$YEAR/$MONTH/$DAY/daemon.log"
459                                       owner(root) group(adm) perm(0640) dir_perm(0755) create_dirs(yes) dir_owner(root) dir_group(adm)); };
460 destination hostdest_kern           { file("/var/log/hosts/$HOST/$YEAR/$MONTH/$DAY/kern.log"
461                                       owner(root) group(adm) perm(0640) dir_perm(0755) create_dirs(yes) dir_owner(root) dir_group(adm)); };
462 destination hostdest_lpr            { file("/var/log/hosts/$HOST/$YEAR/$MONTH/$DAY/lpr.log"
463                                       owner(root) group(adm) perm(0640) dir_perm(0755) create_dirs(yes) dir_owner(root) dir_group(adm)); };
464 destination hostdest_mail           { file("/var/log/hosts/$HOST/$YEAR/$MONTH/$DAY/mail.log"
465                                       owner(root) group(adm) perm(0640) dir_perm(0755) create_dirs(yes) dir_owner(root) dir_group(adm)); };
466 destination hostdest_news           { file("/var/log/hosts/$HOST/$YEAR/$MONTH/$DAY/news.log"
467                                       owner(root) group(adm) perm(0640) dir_perm(0755) create_dirs(yes) dir_owner(root) dir_group(adm)); };
468 destination hostdest_user           { file("/var/log/hosts/$HOST/$YEAR/$MONTH/$DAY/user.log"
469                                       owner(root) group(adm) perm(0640) dir_perm(0755) create_dirs(yes) dir_owner(root) dir_group(adm)); };
470 destination hostdest_uucp           { file("/var/log/hosts/$HOST/$YEAR/$MONTH/$DAY/uucp.log"
471                                       owner(root) group(adm) perm(0640) dir_perm(0755) create_dirs(yes) dir_owner(root) dir_group(adm)); };
472 destination hostdest_debug          { file("/var/log/hosts/$HOST/$YEAR/$MONTH/$DAY/debug"
473                                       owner(root) group(adm) perm(0640) dir_perm(0755) create_dirs(yes) dir_owner(root) dir_group(adm)); };
474 destination hostdest_messages       { file("/var/log/hosts/$HOST/$YEAR/$MONTH/$DAY/messages"
475                                       owner(root) group(adm) perm(0640) dir_perm(0755) create_dirs(yes) dir_owner(root) dir_group(adm)); };
476
477
478 #----------------------------------------------------------------------
479 #  Special catch all destination hostdest_sorting by host
480 #----------------------------------------------------------------------
481 destination hostdest_facility_dot_info   { file("/var/log/hosts/$HOST/$YEAR/$MONTH/$DAY/$FACILITY.info"
482                                            owner(root) group(adm) perm(0640) dir_perm(0755) create_dirs(yes) dir_owner(root) dir_group(adm)); };
483 destination hostdest_facility_dot_notice { file("/var/log/hosts/$HOST/$YEAR/$MONTH/$DAY/$FACILITY.notice"
484                                            owner(root) group(adm) perm(0640) dir_perm(0755) create_dirs(yes) dir_owner(root) dir_group(adm)); };
485 destination hostdest_facility_dot_warn   { file("/var/log/hosts/$HOST/$YEAR/$MONTH/$DAY/$FACILITY.warn"
486                                            owner(root) group(adm) perm(0640) dir_perm(0755) create_dirs(yes) dir_owner(root) dir_group(adm)); };
487 destination hostdest_facility_dot_err    { file("/var/log/hosts/$HOST/$YEAR/$MONTH/$DAY/$FACILITY.err"
488                                            owner(root) group(adm) perm(0640) dir_perm(0755) create_dirs(yes) dir_owner(root) dir_group(adm)); };
489 destination hostdest_facility_dot_crit   { file("/var/log/hosts/$HOST/$YEAR/$MONTH/$DAY/$FACILITY.crit"
490                                            owner(root) group(adm) perm(0640) dir_perm(0755) create_dirs(yes) dir_owner(root) dir_group(adm)); };
491
492
493 #----------------------------------------------------------------------
494 #  Catch all log files
495 #----------------------------------------------------------------------
496 destination df_ALL_auth { file("/var/log/auth-all.log"); };
497 destination df_ALL_mail { file("/var/log/mail-all.log"); };
498 destination df_ALL_syslog { file("/var/log/syslog-all"); };
499
500 log { source(s_local);
501       source(s_network);
502       filter(f_auth); destination(hostdest_auth); };
503 log { source(s_local);
504       source(s_network);
505       filter(f_syslog); destination(hostdest_syslog); };
506 log { source(s_local);
507       source(s_network);
508       filter(f_daemon); destination(hostdest_daemon); };
509 log { source(s_local);
510       source(s_network);
511       filter(f_kern); destination(hostdest_kern); };
512 log { source(s_local);
513       source(s_network);
514       filter(f_lpr); destination(hostdest_lpr); };
515 log { source(s_local);
516       source(s_network);
517       filter(f_mail); destination(hostdest_mail); };
518 log { source(s_local);
519       source(s_network);
520       filter(f_news); destination(hostdest_mail); };
521 log { source(s_local);
522       source(s_network);
523       filter(f_user); destination(hostdest_user); };
524 log { source(s_local);
525       source(s_network);
526       filter(f_uucp); destination(hostdest_uucp); };
527 log { source(s_local);
528       source(s_network);
529       filter(f_debug); destination(hostdest_debug); };
530 log { source(s_local);
531       source(s_network);
532       filter(f_messages); destination(hostdest_messages); };
533
534 log { source(s_local);
535       source(s_network);
536       filter(f_mail); filter(f_at_least_info); destination(hostdest_facility_dot_info); };
537 log { source(s_local);
538       source(s_network);
539       filter(f_mail); filter(f_at_least_warn); destination(hostdest_facility_dot_warn); };
540 log { source(s_local);
541       source(s_network);
542       filter(f_mail); filter(f_at_least_err); destination(hostdest_facility_dot_err); };
543
544
545 ## catch all:
546 log { source(s_local);
547       source(s_network);
548       filter(f_auth); destination(df_ALL_auth); };
549 log { source(s_local);
550       source(s_network);
551       filter(f_mail); destination(df_ALL_mail); };
552 log { source(s_local);
553       source(s_network);
554       filter(f_syslog); destination(df_ALL_syslog); };
555 <%- end -%>