\index[general]{Messages Resource}
The Messages resource defines how messages are to be handled and destinations
-to which they should be sent.
+to which they should be sent.
Even though each daemon has a full message handler, within the File daemon and
the Storage daemon, you will normally choose to send all the appropriate
For example, you may want all error messages both logged as well as sent to
you in an email. By defining multiple messages resources, you can have
different message handling for each type of Job (e.g. Full backups versus
-Incremental backups).
+Incremental backups).
In general, messages are attached to a Job and are included in the Job report.
There are some rare cases, where this is not possible, e.g. when no job is
flushed at the end of the next Job. However, since such messages are not
attached to a Job, any that are mailed will be sent to {\bf
/usr/lib/sendmail}. On some systems, such as FreeBSD, if your sendmail is in a
-different place, you may want to link it to the the above location.
+different place, you may want to link it to the the above location.
The records contained in a Messages resource consist of a {\bf destination}
-specification followed by a list of {\bf message-types} in the format:
+specification followed by a list of {\bf message-types} in the format:
\begin{description}
\index[dir]{destination}
\end{description}
-or for those destinations that need and address specification (e.g. email):
+or for those destinations that need and address specification (e.g. email):
\begin{description}
message-type} is one of a predefined set of keywords that define the type of
message generated by {\bf Bacula} ({\bf ERROR}, {\bf WARNING}, {\bf FATAL},
...), and {\bf address} varies according to the {\bf destination} keyword, but
- is typically an email address or a filename.
+ is typically an email address or a filename.
\end{description}
The following are the list of the possible record definitions that can be used
-in a message resource.
+in a message resource.
\begin{description}
\item [Messages]
\index[dir]{Messages}
- Start of the Messages records.
+ Start of the Messages records.
\item [Name = \lt{}name\gt{}]
\index[dir]{Name}
The name of the Messages resource. The name you specify here will be used to
- tie this Messages resource to a Job and/or to the daemon.
+ tie this Messages resource to a Job and/or to the daemon.
\label{mailcommand}
\item [MailCommand = \lt{}command\gt{}]
\index[dir]{MailCommand}
In the absence of this resource, Bacula will send all mail using the
- following command:
+ following command:
-{\bf mail -s "Bacula Message" \lt{}recipients\gt{}}
+{\bf mail -s "Bacula Message" \lt{}recipients\gt{}}
-In many cases, depending on your machine, this command may not work.
+In many cases, depending on your machine, this command may not work.
However, by using the {\bf MailCommand}, you can specify exactly how to
send the mail. During the processing of the {\bf command} part, normally
specified as a quoted string, the following substitutions will be used:
-\begin{itemize}
-\item \%\% = \%
-\item \%c = Client's name
-\item \%d = Director's name
-\item \%e = Job Exit code (OK, Error, ...)
+\begin{bsysitemize}
+\item \%\% = \%
+\item \%c = Client's name
+\item \%d = Director's name
+\item \%e = Job Exit code (OK, Error, ...)
\item \%h = Client address
-\item \%i = Job Id
-\item \%j = Unique Job name
-\item \%l = Job level
-\item \%n = Job name
-\item \%r = Recipients
+\item \%i = Job Id
+\item \%j = Unique Job name
+\item \%l = Job level
+\item \%n = Job name
+\item \%r = Recipients
\item \%s = Since time
-\item \%t = Job type (e.g. Backup, ...)
+\item \%t = Job type (e.g. Backup, ...)
\item \%v = Volume name (Only on director side)
-\end{itemize}
+\end{bsysitemize}
-Please note: any {\bf MailCommand} directive must be specified
+Please note: any {\bf MailCommand} directive must be specified
in the {\bf Messages} resource {\bf before} the desired
{\bf Mail}, {\bf MailOnSuccess}, or {\bf MailOnError}
directive. In fact, each of those directives may be preceded by
The following is the command I (Kern) use. Note, the whole command should
appear on a single line in the configuration file rather than split as is
-done here for presentation:
+done here for presentation:
{\bf mailcommand = "/home/kern/bacula/bin/bsmtp -h mail.example.com -f
\textbackslash{}"\textbackslash{}(Bacula\textbackslash{})
\%l\textbackslash{}" \%r"}
The {\bf bsmtp} program is provided as part of {\bf Bacula}. For
-additional details, please see the
-\ilink{ bsmtp -- Customizing Your Email Messages}{bsmtp} section of
-the Bacula Utility Programs chapter of this manual. Please test any {\bf
+additional details, please see the
+\bsysxrlink{bsmtp -- Customizing Your Email Messages}{bsmtp}{utility}{section} of
+the \utilityman{}. Please test any {\bf
mailcommand} that you use to ensure that your bsmtp gateway accepts the
-addressing form that you use. Certain programs such as Exim can be very
-selective as to what forms are permitted particularly in the from part.
+addressing form that you use. Certain programs such as Exim can be very
+selective as to what forms are permitted particularly in the from part.
\item [OperatorCommand = \lt{}command\gt{}]
\index[fd]{OperatorCommand}
This resource specification is similar to the {\bf MailCommand} except that
it is used for Operator messages. The substitutions performed for the {\bf
MailCommand} are also done for this command. Normally, you will set this
- command to the same value as specified for the {\bf MailCommand}.
+ command to the same value as specified for the {\bf MailCommand}.
The {\bf OperatorCommand} directive must appear in the {\bf Messages}
resource before the {\bf Operator} directive.
\lt{}message-type2\gt{}, ...]
\index[fd]{\lt{}destination\gt{}}
-Where {\bf destination} may be one of the following:
+Where {\bf destination} may be one of the following:
\begin{description}
\item [stdout]
\index[fd]{stdout}
- Send the message to standard output.
+ Send the message to standard output.
\item [stderr]
\index[fd]{stderr}
- Send the message to standard error.
+ Send the message to standard error.
\item [console]
\index[console]{console}
Send the message to the console (Bacula Console). These messages are held
-until the console program connects to the Director.
+until the console program connects to the Director.
\end{description}
\item {\bf \lt{}destination\gt{} = \lt{}address\gt{} =
\lt{}message-type1\gt{}, \lt{}message-type2\gt{}, ...}
\index[console]{\lt{}destination\gt{}}
-Where {\bf address} depends on the {\bf destination}.
+Where {\bf address} depends on the {\bf destination}.
-The {\bf destination} may be one of the following:
+The {\bf destination} may be one of the following:
\begin{description}
\index[general]{director}
Send the message to the Director whose name is given in the {\bf address}
field. Note, in the current implementation, the Director Name is ignored, and
- the message is sent to the Director that started the Job.
+ the message is sent to the Director that started the Job.
\item [file]
\index[dir]{file}
\index[general]{file}
Send the message to the filename given in the {\bf address} field. If the
- file already exists, it will be overwritten.
+ file already exists, it will be overwritten.
\item [append]
\index[dir]{append}
\index[general]{append}
Append the message to the filename given in the {\bf address} field. If the
file already exists, it will be appended to. If the file does not exist, it
- will be created.
+ will be created.
\item [syslog]
\index[general]{syslog}
ignored and the message is always sent to the LOG\_DAEMON facility with
level LOG\_ERR. See {\bf man 3 syslog} for more details. Example:
-\begin{verbatim}
+\begin{lstlisting}
syslog = all, !skipped
-\end{verbatim}
+\end{lstlisting}
Although the {\bf syslog} destination is not used in the default Bacula
config files, in certain cases where Bacula encounters errors in trying
separated list in the {\bf address} field. This is similar to {\bf
mail} above, except that each message is sent as received. Thus there
is one email per message. This is most useful for {\bf mount} messages
- (see below).
+ (see below).
\item [console]
\index[general]{console}
also be added. This permits Job Reports and other messages to
be recorded in the Catalog so that they can be accessed by
reporting software. Bacula will prune the Log records associated
- with a Job when the Job records are pruned. Otherwise, Bacula
+ with a Job when the Job records are pruned. Otherwise, Bacula
never uses these records internally, so this destination is only
used for special purpose programs (e.g. {\bf bweb}).
\item [info]
\index[general]{info}
- General information messages.
+ General information messages.
\item [warning]
\index[general]{warning}
Warning messages. Generally this is some unusual condition but not expected
- to be serious.
+ to be serious.
\item [error]
\index[general]{error}
Non-fatal error messages. The job continues running. Any error message should
- be investigated as it means that something went wrong.
+ be investigated as it means that something went wrong.
\item [fatal]
\index[general]{fatal}
- Fatal error messages. Fatal errors cause the job to terminate.
+ Fatal error messages. Fatal errors cause the job to terminate.
\item [terminate]
\index[general]{terminate}
- Message generated when the daemon shuts down.
+ Message generated when the daemon shuts down.
\item [notsaved]
\index[fd]{notsaved}
\index[general]{notsaved}
Files not saved because of some error. Usually because the file cannot be
- accessed (i.e. it does not exist or is not mounted).
+ accessed (i.e. it does not exist or is not mounted).
\item [skipped]
\index[fd]{skipped}
\item [all]
\index[general]{all}
- All message types.
+ All message types.
\item [security]
\index[general]{security}
- Security info/warning messages principally from unauthorized
+ Security info/warning messages principally from unauthorized
connection attempts.
\item [alert]
to the console:
\footnotesize
-\begin{verbatim}
+\begin{lstlisting}
Messages {
Name = Standard
mail = enforcement@sec.com = all, !skipped, !terminate
operator = enforcement@sec.com = mount
console = all, !skipped, !saved
}
-\end{verbatim}
+\end{lstlisting}
\normalsize
With the exception of the email address (changed to avoid junk mail from
robot's), an example Director's Messages resource is as follows. Note, the {\bf
mailcommand} and {\bf operatorcommand} are on a single line -- they had to be
-split for this manual:
+split for this manual:
\footnotesize
-\begin{verbatim}
+\begin{lstlisting}
Messages {
Name = Standard
mailcommand = "bacula/bin/bsmtp -h mail.example.com \
operator = security@example.com = mount
console = all, !skipped, !saved
}
-\end{verbatim}
+\end{lstlisting}
\normalsize