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