Bacula-users

Re: [Bacula-users] How to get notified about non-fatal errors

2011-12-19 09:54:23
Subject: Re: [Bacula-users] How to get notified about non-fatal errors
From: Machiel van Veen <mvv AT sentia DOT nl>
To: bacula-users AT lists.sourceforge DOT net
Date: Mon, 19 Dec 2011 15:33:37 +0100
On Monday 19 December 2011 12:01:59 Mario Moder wrote:
> Hi
> 
> Looking through the docs and searching the mailing list, I haven't found
> a solution to my problem yet:
> 
> A windows backup job is terminating normally, sometimes with a non-fatal
> error:
> 
> Error: Read error on file d:/Backup/backup_201112190102.bak. ERR=Nicht
> gen\374gend Systemressourcen, um den angeforderten Dienst auszuf\374hren
> 
> (FYI: I haven't found the cause for this yet, but it doesn't really
> matter with regard to Bacula, see below)
> 
> I get a notification mail about this job because of a Messages resource:
> 
> mailcommand = "/usr/lib/bacula/bsmtp -h localhost -f \"\(Bacula\) %r\"
> -s \"Bacula: %t %e of %n %l\" %r"
> 
> The problem is that the subject line for this says:
> 
> Bacula: Backup OK of reha11-dbbak-job Full
> 
> Buried in the body of the mail there is the error mentioned above and in
> the summary:
> 
> Non-fatal FD errors:    2
> SD Errors:              0
> FD termination status:  OK
> SD termination status:  OK
> Termination:            Backup OK -- with warnings
> 
> How do I get this termination code (or some other form of warning) in
> the subject line of the mail? Or how do I get the job to fail? I need
> the file from the non-fatal error be backuped or at least be loudly
> warned if it isn't fully backuped...
> 

Hi Mario,

I use Procmail for this myself, it works perfectly, only mailing me relevant 
messages. Bacula sends the messages to bacula@localhost then forward any 
error/warning messages. I am 
using Postfix as a mail server.

- Configure the bacula messages

/etc/bacula/bacula-dir.conf

...
Messages {
    Name = Standard
    console = all, !skipped, !saved
    append = "/var/log/bacula/bacula.log" = all, !skipped
    mailcommand = "/usr/sbin/bsmtp -h localhost -f \"\(Bacula\) %r\" -s 
\"Bacula daemon message\" %r" 
    mail = bacula@localhost = all
    catalog = all
}
...

- Create a .forward for the bacula user

/var/lib/bacula/.forward

...
"|exec /usr/bin/procmail -t"
...

- Create a .procmailrc for the bacula user

/var/lib/bacula/.procmailrc

...
SHELL=/bin/sh
DEFAULT=/dev/null/
LOGFILE=/var/log/bacula/procmail.log
MAILDIR=/dev/null/
##LOGABSTRACT=all
VERBOSE=on
:0 B
* ! ^  Termination:            Backup OK$
! bacula AT example DOT com
:0
/dev/null
...

-- 
Machiel.

------------------------------------------------------------------------------
Learn Windows Azure Live!  Tuesday, Dec 13, 2011
Microsoft is holding a special Learn Windows Azure training event for 
developers. It will provide a great way to learn Windows Azure and what it 
provides. You can attend the event by watching it streamed LIVE online.  
Learn more at http://p.sf.net/sfu/ms-windowsazure
_______________________________________________
Bacula-users mailing list
Bacula-users AT lists.sourceforge DOT net
https://lists.sourceforge.net/lists/listinfo/bacula-users