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