]> git.donarmstrong.com Git - dsa-puppet.git/blob - templates/syslog-ng.conf.erb
f21ccc5f6fc01d524293992118ddaaff2e177549
[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
86
87 ######
88 # sources
89
90 # all known message sources
91 source s_all {
92         # message generated by Syslog-NG
93         internal();
94 <% if kernel == 'Linux' %>
95         # standard Linux log source (this is the default place for the syslog()
96         # function to send logs to)
97         unix-stream("/dev/log");
98         # messages from the kernel
99 <% if syslogversion == "2" -%>
100         file("/proc/kmsg" log_prefix("kernel: "));
101 <% else %>
102         file("/proc/kmsg" program_override("kernel: "));
103 <%end%>
104 <%else%>
105         # standard Linux log source (this is the default place for the syslog()
106         # function to send logs to)
107         unix-dgram("/var/run/log");
108         # messages from the kernel
109 <% if syslogversion == "2" -%>
110         file("/dev/klog" log_prefix("kernel: "));
111 <% else %>
112         file("/dev/klog" program_override("kernel: "));
113 <%end%>
114 <%end%>
115 <% if hostname == "paganini" -%>
116         # use the following line if you want to receive remote UDP logging messages
117         # (this is equivalent to the "-r" syslogd flag)
118         udp();
119 <%end%>
120 };
121
122 <% if hostname == "heininen" -%>
123 source s_network {
124         tcp6(port(5140)
125                 tls( key_file("/etc/exim4/ssl/thishost.key")
126                      cert_file("/etc/exim4/ssl/thishost.cert")
127                      ca_dir("/etc/exim4/ssl/")
128                 )
129         );
130 };
131 <%end%>
132
133
134 ######
135 # destinations
136
137 # some standard log files
138 destination df_auth { file("/var/log/auth.log"); };
139 destination df_syslog { file("/var/log/syslog"); };
140 destination df_cron { file("/var/log/cron.log"); };
141 destination df_daemon { file("/var/log/daemon.log"); };
142 destination df_kern { file("/var/log/kern.log"); };
143 destination df_lpr { file("/var/log/lpr.log"); };
144 destination df_mail { file("/var/log/mail.log" group(maillog)); };
145 destination df_mail_info { file("/var/log/mail.info" group(maillog)); };
146 destination df_mail_warn { file("/var/log/mail.warn" group(maillog)); };
147 destination df_mail_err { file("/var/log/mail.err" group(maillog)); };
148 destination df_user { file("/var/log/user.log" perm(0644)); };
149 destination df_uucp { file("/var/log/uucp.log"); };
150
151 # these files are meant for the mail system log files
152 # and provide re-usable destinations for {mail,cron,...}.info,
153 # {mail,cron,...}.notice, etc.
154 destination df_facility_dot_info { file("/var/log/$FACILITY.info"); };
155 destination df_facility_dot_notice { file("/var/log/$FACILITY.notice"); };
156 destination df_facility_dot_warn { file("/var/log/$FACILITY.warn"); };
157 destination df_facility_dot_err { file("/var/log/$FACILITY.err"); };
158 destination df_facility_dot_crit { file("/var/log/$FACILITY.crit"); };
159
160 # these files are meant for the news system, and are kept separated
161 # because they should be owned by "news" instead of "root"
162 destination df_news_dot_notice { file("/var/log/news/news.notice" owner("news")); };
163 destination df_news_dot_err { file("/var/log/news/news.err" owner("news")); };
164 destination df_news_dot_crit { file("/var/log/news/news.crit" owner("news")); };
165
166 # some more classical and useful files found in standard syslog configurations
167 destination df_debug { file("/var/log/debug"); };
168 destination df_messages { file("/var/log/messages"); };
169
170 <% if kernel == 'Linux' %>
171 # pipes
172 # a console to view log messages under X
173 destination dp_xconsole { pipe("/dev/xconsole"); };
174
175 <% end %>
176 # consoles
177 # this will send messages to everyone logged in
178 destination du_all { usertty("*"); };
179
180
181 ######
182 # filters
183
184 # all messages from the auth and authpriv facilities
185 filter f_auth { facility(auth, authpriv); };
186
187 # all messages except from the auth and authpriv facilities
188 filter f_syslog { not facility(auth, authpriv); };
189
190 # respectively: messages from the cron, daemon, kern, lpr, mail, news, user,
191 # and uucp facilities
192 filter f_cron { facility(cron); };
193 filter f_daemon { facility(daemon); };
194 filter f_kern { facility(kern); };
195 filter f_lpr { facility(lpr); };
196 filter f_mail { facility(mail); };
197 filter f_news { facility(news); };
198 filter f_user { facility(user); };
199 filter f_uucp { facility(uucp); };
200
201 # some filters to select messages of priority greater or equal to info, warn,
202 # and err
203 # (equivalents of syslogd's *.info, *.warn, and *.err)
204 filter f_at_least_info { level(info..emerg); };
205 filter f_at_least_notice { level(notice..emerg); };
206 filter f_at_least_warn { level(warn..emerg); };
207 filter f_at_least_err { level(err..emerg); };
208 filter f_at_least_crit { level(crit..emerg); };
209
210 # all messages of priority debug not coming from the auth, authpriv, news, and
211 # mail facilities
212 filter f_debug { level(debug) and not facility(auth, authpriv, news, mail); };
213
214 # all messages of info, notice, or warn priority not coming form the auth,
215 # authpriv, cron, daemon, mail, and news facilities
216 filter f_messages {
217         level(info,notice,warn)
218             and not facility(auth,authpriv,cron,daemon,mail,news);
219 };
220
221 # messages with priority emerg
222 filter f_emerg { level(emerg); };
223
224 <% if kernel == 'Linux' %>
225 # complex filter for messages usually sent to the xconsole
226 filter f_xconsole {
227     facility(daemon,mail)
228         or level(debug,info,notice,warn)
229         or (facility(news)
230                 and level(crit,err,notice));
231 };
232
233 <% end %>
234 ######
235 # logs
236 # order matters if you use "flags(final);" to mark the end of processing in a
237 # "log" statement
238
239 # these rules provide the same behavior as the commented original syslogd rules
240
241 # auth,authpriv.*                 /var/log/auth.log
242 log {
243         source(s_all);
244 <% if hostname == "heininen" -%>
245         source(s_network);
246 <% end %>
247         filter(f_auth);
248         destination(df_auth);
249 };
250
251 # *.*;auth,authpriv.none          -/var/log/syslog
252 log {
253         source(s_all);
254 <% if hostname == "heininen" -%>
255         source(s_network);
256 <% end %>
257         filter(f_syslog);
258         destination(df_syslog);
259 };
260
261 # this is commented out in the default syslog.conf
262 # cron.*                         /var/log/cron.log
263 #log {
264 #        source(s_all);
265 #        filter(f_cron);
266 #        destination(df_cron);
267 #};
268
269 # daemon.*                        -/var/log/daemon.log
270 log {
271         source(s_all);
272 <% if hostname == "heininen" -%>
273         source(s_network);
274 <% end %>
275         filter(f_daemon);
276         destination(df_daemon);
277 };
278
279 # kern.*                          -/var/log/kern.log
280 log {
281         source(s_all);
282 <% if hostname == "heininen" -%>
283         source(s_network);
284 <% end %>
285         filter(f_kern);
286         destination(df_kern);
287 };
288
289 # lpr.*                           -/var/log/lpr.log
290 log {
291         source(s_all);
292 <% if hostname == "heininen" -%>
293         source(s_network);
294 <% end %>
295         filter(f_lpr);
296         destination(df_lpr);
297 };
298
299 # mail.*                          -/var/log/mail.log
300 log {
301         source(s_all);
302 <% if hostname == "heininen" -%>
303         source(s_network);
304 <% end %>
305         filter(f_mail);
306         destination(df_mail);
307 };
308
309 # user.*                          -/var/log/user.log
310 log {
311         source(s_all);
312 <% if hostname == "heininen" -%>
313         source(s_network);
314 <% end %>
315         filter(f_user);
316         destination(df_user);
317 };
318
319 # uucp.*                          /var/log/uucp.log
320 log {
321         source(s_all);
322 <% if hostname == "heininen" -%>
323         source(s_network);
324 <% end %>
325         filter(f_uucp);
326         destination(df_uucp);
327 };
328
329 # mail.info                       -/var/log/mail.info
330 log {
331         source(s_all);
332 <% if hostname == "heininen" -%>
333         source(s_network);
334 <% end %>
335         filter(f_mail);
336         filter(f_at_least_info);
337         destination(df_mail_info);
338 };
339
340 # mail.warn                       -/var/log/mail.warn
341 log {
342         source(s_all);
343 <% if hostname == "heininen" -%>
344         source(s_network);
345 <% end %>
346         filter(f_mail);
347         filter(f_at_least_warn);
348         destination(df_mail_warn);
349 };
350
351 # mail.err                        /var/log/mail.err
352 log {
353         source(s_all);
354 <% if hostname == "heininen" -%>
355         source(s_network);
356 <% end %>
357         filter(f_mail);
358         filter(f_at_least_err);
359         destination(df_mail_err);
360 };
361
362 # news.crit                       /var/log/news/news.crit
363 log {
364         source(s_all);
365 <% if hostname == "heininen" -%>
366         source(s_network);
367 <% end %>
368         filter(f_news);
369         filter(f_at_least_crit);
370         destination(df_news_dot_crit);
371 };
372
373 # news.err                        /var/log/news/news.err
374 log {
375         source(s_all);
376 <% if hostname == "heininen" -%>
377         source(s_network);
378 <% end %>
379         filter(f_news);
380         filter(f_at_least_err);
381         destination(df_news_dot_err);
382 };
383
384 # news.notice                     /var/log/news/news.notice
385 log {
386         source(s_all);
387 <% if hostname == "heininen" -%>
388         source(s_network);
389 <% end %>
390         filter(f_news);
391         filter(f_at_least_notice);
392         destination(df_news_dot_notice);
393 };
394
395
396 # *.=debug;\
397 #         auth,authpriv.none;\
398 #         news.none;mail.none     -/var/log/debug
399 log {
400         source(s_all);
401 <% if hostname == "heininen" -%>
402         source(s_network);
403 <% end %>
404         filter(f_debug);
405         destination(df_debug);
406 };
407
408
409 # *.=info;*.=notice;*.=warn;\
410 #         auth,authpriv.none;\
411 #         cron,daemon.none;\
412 #         mail,news.none          -/var/log/messages
413 log {
414         source(s_all);
415 <% if hostname == "heininen" -%>
416         source(s_network);
417 <% end %>
418         filter(f_messages);
419         destination(df_messages);
420 };
421
422 # *.emerg                         *
423 log {
424         source(s_all);
425 <% if hostname == "heininen" -%>
426         source(s_network);
427 <% end %>
428         filter(f_emerg);
429         destination(du_all);
430 };
431
432
433 <% if kernel == 'Linux' %>
434 # daemon.*;mail.*;\
435 #         news.crit;news.err;news.notice;\
436 #         *.=debug;*.=info;\
437 #         *.=notice;*.=warn       |/dev/xconsole
438 log {
439         source(s_all);
440 <% if hostname == "heininen" -%>
441         source(s_network);
442 <% end %>
443         filter(f_xconsole);
444         destination(dp_xconsole);
445 };
446 <%end%>
447
448 <% if hostname == "corelli" -%>
449 destination loghost-paganini {
450         udp("192.168.2.10",port(514));
451 };
452
453 log {
454         source(s_all);
455         destination(loghost-paganini);
456 };
457 <%end%>