]> git.sur5r.net Git - bacula/docs/blob - docs/manual-fr/messagesres.tex
Fin de storedconf.tex, debut de messagesres.tex.
[bacula/docs] / docs / manual-fr / messagesres.tex
1 %%
2 %%
3
4 \section*{La ressource Messages}
5 \label{_ChapterStart15}
6 \index[general]{Ressource!Messages}
7 \index[general]{Messages Ressource}
8 \addcontentsline{toc}{section}{Ressource Messages}
9
10 \subsection*{La ressource  Messages}
11 \label{MessageResource}
12 \index[general]{Ressource!Messages}
13 \index[general]{Messages Ressource}
14 \addcontentsline{toc}{subsection}{La ressource Messages}
15
16 La ressource Messages définit la façon dont les messages doivent être construits 
17 et vers quelles destinations ils doivent être transmis.
18
19 Bien que chaque {\it daemon} intègre un gestionnaire de messages pleinement 
20 fonctionnel, vous choisirez certainement de centraliser les messages appropriés 
21 des File Daemons et du Storage Daemon vers le Director. Ainsi, tous les messages 
22 associés à un job donné peuvent être combinés et envoyés en un simple courrier 
23 électronique vers l'utilisateur, ou enregistré dans quelque fichier de logs.
24
25 Chaque message généré par un {\it daemon} Bacula possède un type associé tel 
26 que INFO, WARNING, ERROR, FATAL, etc. La ressource Messages vous permet de 
27 stipuler les types de messages que vous voulez voir, et où les envoyer. De plus, 
28 un message peut être expédié vers plusieurs destinations. Par exemple, vous 
29 pouvez faire en sorte quque tous les messages d'erreur soient consignés dans un 
30 fichier de logs tout en vous étant envoyés par courrier élecronique. En 
31 définissant plusieurs ressources Messages, vous pouvez profiter de différents 
32 modes de prise en charge pour chaque type de job (par exemple, selon qu'il 
33 s'agit d'une full ou d'un incrémentale). 
34
35 En général, les messages sont attachés à un job et sont inclus dans le rapport de job. 
36 Il existe de rares situations où ce n'est pas possible, par exemple lorsqu'aucun 
37 job n'est en cours d'exécution, ou si une erreur de communication se produit 
38 entre un daemon et le Director. Dans ce genre de situations, le message demeure 
39 dans le système et devrait être purgé à la fin job suivant. Cependant, comme de tels 
40 messages ne sont pas attachés à un job, tous ceux qui sont envoyés par courrier 
41 électronique sont envoyés à {\bf /usr/lib/sendmail}. Si sur votre système, comme c'est 
42 le cas de FreeBSD, sendmail réside en un autre emplacement, veillez à le lier 
43 depuis l'emplacement ci-dessus. 
44
45 Les enregistrements contenus dans une ressource Messages consistent en une 
46 spécification de  {\bf destination} suivie d'une liste de types de messages 
47 {\bf message-types} au format :
48
49 \begin{description}
50
51 \item [destination = message-type1, message-type2, message-type3, ...  ]
52    \index[dir]{destination}
53    \end{description}
54
55 ou, pour ces destinations qui nécessitent de spécifier une adresse (e-mail, par exemple) :
56
57 \begin{description}
58
59 \item [destination = address = message-type1, message-type2,
60    message-type3, ...  ]
61    \index[dir]{destination}
62
63 où {\bf destination} est l'un des mots-clef prédéfinis qui précise où le message 
64 doit être expédié ({\bf stdout}, {\bf file}, ...), {\bf  message-type} est l'un des 
65 mots-clef prédéfinis qui précise le type de messages généré par Bacula ({\bf ERROR}, 
66 {\bf WARNING}, {\bf FATAL}, ...) et {\bf address} varie selon le mot clef  {\bf destination} 
67 mais peut typiquement être une adresse de courrier électronique ou un nom de fichier.
68
69 \end{description}
70
71 Voici la liste des directives disponibles pour définir des ressources Messages :
72
73
74 \begin{description}
75
76 \item [Messages]
77    \index[dir]{Messages}
78    Début des enregistrements de Messages
79
80 \item [Name = \lt{}name\gt{}]
81    \index[dir]{Name}
82    Le nom de la ressource Message. Ce nom sera utilisé pour lier cette ressource 
83 Message à un job et/ou au un daemon.
84
85 \label{mailcommand}
86
87 \item [MailCommand = \lt{}command\gt{}]
88    \index[dir]{MailCommand}
89 En l'absence de cette directive, Bacula enverra tous ses messages avec la 
90 commande suivante :
91
92 {\bf mail -s "Bacula Message" \lt{}recipients\gt{}}  
93 Dans de nombreusx cas, selon votre machine, cette commande peut ne pas fonctionner. 
94 La directive  {\bf MailCommand} vous permet de stipuler précisément la façon 
95 d'envoyer vos courrier électroniques. Lors de l'exécution de la commande 
96 {\bf command}, spécifiée entre guillemets, les substitutions suivantes sont 
97 effectuées :
98
99 \begin{itemize}
100   \item \%\% = \%  
101   \item \%c = Le nom du client
102   \item \%d = Le nom du Director  
103   \item \%e = Le code de sortie du job (OK, Error, ...)  
104   \item \%i = L'Id du Job  
105   \item \%j = Le nom unique du job  
106   \item \%l = Le niveau (Full, differential, ...) du job  
107   \item \%n = Le om du job  
108   \item \%r = Les destinataires  
109   \item \%t = Le type du job (Backup, verify, ...)  
110 \end{itemize}
111
112 Voici la commande que j'utilise (Kern) :
113
114 {\bf mailcommand = "/home/kern/bacula/bin/bsmtp -h mail.example.com -f
115 \textbackslash{}"\textbackslash{}(Bacula\textbackslash{})
116 \%r\textbackslash{}" -s \textbackslash{}"Bacula: \%t \%e of \%c
117 \%l\textbackslash{}" \%r"}
118
119 Notez que la commande entière devrait apparaître sur une seulle ligne plutôt 
120 que découpée comme ici pour des raisons de présentation.
121
122 Le programme {\bf bsmtp} est fourni en tant que partie de Bacula. Pour plus 
123 de détails, consultez la section \ilink{ bsmtp -- Personnaliser l'envoi 
124 de vos message par courrier électronique}{bsmtp}. Testez soigneusement 
125 toute commande {\bf mailcommand} pour vous assurer que votre passerelle 
126 bsmtp accepte le format d'adressage que vous utilisez. Certains programmes 
127 tels Exim peut se montrer très sélectif en ce qui concerne les format 
128 autorisés, particulièrement en ce qui concerne le champ "from".
129
130 \item [OperatorCommand = \lt{}command\gt{}]
131    \index[fd]{OperatorCommand}
132    This resource specification is  similar to the {\bf MailCommand} except that
133 it is used for Operator  messages. The substitutions performed for the {\bf
134 MailCommand} are  also done for this command. Normally, you will set this
135 command to the  same value as specified for the {\bf MailCommand}. 
136
137 \item [Debug = \lt{}debug-level\gt{}]
138    \index[fd]{Debug}
139    This sets the debug message level  to the debug level, which is an integer.
140 Higher debug levels cause more  debug information to be produced. You are
141 requested not to use this  record since it will be deprecated. 
142
143 \item [\lt{}destination\gt{} = \lt{}message-type1\gt{},
144    \lt{}message-type2\gt{}, ...]
145    \index[fd]{\lt{}destination\gt{}}
146
147 Where {\bf destination} may be one of the following:  
148
149 \begin{description}
150
151 \item [stdout]
152    \index[fd]{stdout}
153    Send the message to standard output.  
154
155 \item [stderr]
156    \index[fd]{stderr}
157    Send the message to standard error.  
158
159 \item [console]
160    \index[console]{console}
161    Send the message to the console (Bacula Console).  These messages are held
162 until the console program  connects to the Director.  
163 \end{description}
164
165 \item {\bf \lt{}destination\gt{} = \lt{}address\gt{} =
166    \lt{}message-type1\gt{}, \lt{}message-type2\gt{}, ...}
167    \index[console]{\lt{}destination\gt{}}
168
169 Where {\bf address} depends on the {\bf destination}, which  may be one of the
170 following:  
171
172 \begin{description}
173
174 \item [director]
175    \index[dir]{director}
176    Send the message to the Director whose name  is given in the {\bf address}
177 field. Note, in the current  implementation, the Director Name is ignored, and
178 the message  is sent to the Director that started the Job.  
179
180 \item [file]
181    \index[dir]{file}
182    Send the message to the filename given in  the {\bf address} field. If the
183 file already exists, it will be  overwritten.  
184
185 \item [append]
186    \index[dir]{append}
187    Append the message to the filename given  in the {\bf address} field. If the
188    file already exists, it will  be appended to. If the file does not exist, it
189    will be created.  
190
191 \item [syslog]
192    \index[fd]{syslog}
193    Send the message to the system log (syslog)  using the facility specified in
194    the {\bf address} field.  Note, for the moment, the {\bf address} field is
195    ignored  and the message is always sent to the LOG_DAEMON facility with
196    level LOG_ERR. See {\bf man 3 syslog} for more details. Example:
197 \begin{verbatim}
198    syslog = all, !skipped, !saved
199 \end{verbatim}
200
201 \item [mail]
202    \index[fd]{mail}
203    Send the message to the email addresses that are given as a comma
204    separated list in the {\bf address} field.  Mail messages are grouped
205    together during a job and then sent as a single email message when the
206    job terminates.  The advantage of this destination is that you are
207    notified about every Job that runs.  However, if you backup 5 or 10
208    machines every night, the volume of email messages can be important.
209    Some users use filter programs such as {\bf procmail} to automatically
210    file this email based on the Job termination code (see {\bf
211    mailcommand}).
212
213 \item [mail on error]
214    \index[fd]{mail on error}
215    Send the message to the email addresses that are given as a comma
216    separated list in the {\bf address} field if the Job terminates with an
217    error condition.  MailOnError messages are grouped together during a job
218    and then sent as a single email message when the job terminates.  This
219    destination differs from the {\bf mail} destination in that if the Job
220    terminates normally, the message is totally discarded (for this
221    destination).  If the Job terminates in error, it is emailed.  By using
222    other destinations such as {\bf append} you can ensure that even if the
223    Job terminates normally, the output information is saved.
224
225 \item [operator]
226    \index[fd]{operator}
227    Send the message to the email addresses that are specified as a comma
228    separated list in the {\bf address} field.  This is similar to {\bf
229    mail} above, except that each message is sent as received.  Thus there
230    is one email per message.  This is most useful for {\bf mount} messages
231    (see below).  \end{description}
232
233    For any destination, the {\bf message-type} field is a comma separated
234    list of the following types or classes of messages:
235
236 \begin{description}
237
238 \item [info]
239    \index[fd]{info}
240    General information messages.  
241
242 \item [warning]
243    \index[fd]{warning}
244    Warning messages. Generally this is some  unusual condition but not expected
245 to be serious. 
246
247 \item [error]
248    \index[fd]{error}
249    Non-fatal error messages. The job continues running.  Any error message should
250 be investigated as it means that something  went wrong.  
251
252 \item [fatal]
253    \index[fd]{fatal}
254    Fatal error messages. Fatal errors cause the  job to terminate.  
255
256 \item [terminate]
257    \index[fd]{terminate}
258    Message generated when the daemon shuts down.  
259
260 \item [saved]
261    \index[fd]{saved}
262    Files saved normally.  
263
264 \item [notsaved]
265    \index[fd]{notsaved}
266    Files not saved because of some error.  Usually because the file cannot be
267 accessed (i.e. it does not  exist or is not mounted).  
268
269 \item [skipped]
270    \index[fd]{skipped}
271    Files that were skipped because of a user supplied option such as an
272    incremental backup or a file that matches an exclusion pattern.  This is
273    not considered an error condition such as the files listed for the {\bf
274    notsaved} type because the configuration file explicitly requests these
275    types of files to be skipped.  For example, any unchanged file during an
276    incremental backup, or any subdirectory if the no recursion option is
277    specified.
278
279 \item [mount]
280    \index[dir]{mount}
281    Volume mount or intervention requests from the Storage daemon.  These
282    requests require a specific operator intervention for the job to
283    continue.
284
285 \item [restored]
286    \index[dir]{restored}
287    The {\bf ls} style listing generated for each file restored is sent to
288    this message class.
289
290 \item [all]
291    \index[fd]{all}
292    All message types.  
293
294 \item [*security]
295    \index[fd]{*security}
296    Security info/warning messages principally from unauthorized      
297    connection attempts.
298 \end{description}
299
300 \end{description}
301
302 The following is an example of a valid Messages resource definition, where
303 all messages except files explicitly skipped or daemon termination messages
304 are sent by email to enforcement@sec.com.  In addition all mount messages
305 are sent to the operator (i.e.  emailed to enforcement@sec.com).  Finally
306 all messages other than explicitly skipped files and files saved are sent
307 to the console:
308
309 \footnotesize
310 \begin{verbatim}
311 Messages {
312   Name = Standard
313   mail = enforcement@sec.com = all, !skipped, !terminate
314   operator = enforcement@sec.com = mount
315   console = all, !skipped, !saved
316 }
317 \end{verbatim}
318 \normalsize
319
320 With the exception of the email address (changed to avoid junk mail from
321 robot's), Kern's Director's Messages resource is as follows. Note, the {\bf
322 mailcommand} and {\bf operatorcommand} are on a single line -- they had to be
323 split for this manual: 
324
325 \footnotesize
326 \begin{verbatim}
327 Messages {
328   Name = Standard
329   mailcommand = "bacula/bin/bsmtp -h mail.example.com \
330     -f \"\(Bacula\) %r\" -s \"Bacula: %t %e of %c %l\" %r"
331   operatorcommand = "bacula/bin/bsmtp -h mail.example.com \
332     -f \"\(Bacula\) %r\" -s \"Bacula: Intervention needed \
333         for %j\" %r"
334   MailOnError = security@example.com = all, !skipped, \
335                 !terminate
336   append = "bacula/bin/log" = all, !skipped, !terminate
337   operator = security@example.com = mount
338   console = all, !skipped, !saved
339 }
340 \end{verbatim}
341 \normalsize