Bacula-users

Re: [Bacula-users] messages configuration

2009-01-14 11:09:15
Subject: Re: [Bacula-users] messages configuration
From: Thomas <thomas AT ic3s DOT de>
To: bacula-users <bacula-users AT lists.sourceforge DOT net>
Date: Wed, 14 Jan 2009 17:06:25 +0100
Hi Troy,

thanks for the hint,
"Mail on error = mail@address = all"
did it.

Regards

Thomas

Troy Daniels schrieb:
> Hi,
> 
> On Sat, 2009-01-03 at 22:35 +0100, Thomas wrote:
>> ah, now i got it (i think)
>>
>> in the source code there are different log level defined: info, warning, 
>> error, ...
>> and every level is passed to the resource where the level matched.
>> so the "fatal" email address gets only the line of output where the fatal 
>> error happens.
>> the "all" email gets also the informational lines of the output.
>>
>> i think this is very bad and should be fixed in the code and not in the 
>> documentation.
>> every fatal message should also get the informational lines which leads to 
>> the fatal error.
>>
>> i know that fatal messages should be addressed to people how can handle them,
>> but in a team of 10 that is not always the fact, they should receive this 
>> additional information too
>>
> 
> I believe the behaviour you are after can be achieved using the 'Mail on
> Error' configuration setting instead of 'Mail'.
> 
> At least that's how my site's setup and AFAIK the other agents get the
> whole email if the job fails in anyway.
> 
> I haven't checked the latest documentation to see if this option has
> been changed since I implemented it however, so it might be worth a
> look.
> 
> Cheers,
> 
> 
> Troy.
> 
>>
>>
>>
>> Dan Langille schrieb:
>>> Thomas wrote:
>>>
>>> Please do not top post.  See below.
>>>> Dan Langille schrieb:
>>>>> Thomas wrote:
>>>>>> Hi list,
>>>>>>
>>>>>> i have this messages configuration
>>>>>>
>>>>>> Messages {
>>>>>>   Name = Standard
>>>>>>   mailcommand = "/sbin/bsmtp -h localhost -f \"\(Bacula\) %r\" -s
>>>>>> \"Bacula: %t %e of %c %l\" %r"
>>>>>>   operatorcommand = "/sbin/bsmtp -h localhost -f \"\(Bacula\) %r\" -s
>>>>>> \"Bacula: Intervention needed for %j\" %r"
>>>>>>   mail = thomas AT ic3s DOT de = all
>>>>>>   mail = all-other-admins AT ic3s DOT de = warning, error, fatal, 
>>>>>> terminate
>>>>> I have not read the documentation recently, but the above line tells me:
>>>>> send any "warning, error, fatal, terminate" messages to
>>>>> all-other-admins AT ic3s DOT de which is exactly what it is doing.
>>>>>
>>>>> NOTE: message != email.
>>>>>
>>>>>>   operator = all-admins AT ic3s DOT de = mount
>>>>>>   console = all, !skipped, !saved
>>>>>>   catalog = all
>>>>>>   append = "/var/lib/bacula/log" = all #, !skipped
>>>>>> }
>>>>>>
>>>>>> after the catalog backup i run an admin job which rsyncs and than
>>>>>> deletes the catalog backup.
>>>>>> due to a (self made) problem this evening the admin job fails.
>>>>>>
>>>>>> bacula sends two emails, one for me (thomas AT ic3s DOT de):
>>>>>>
>>>>>>> 03-Jan 18:09 backup-dir JobId 60458: BeforeJob: run command
>>>>>>> "/etc/bacula/scripts/sync_and_delete_catalog_backup"
>>>>>>> 03-Jan 18:09 backup-dir JobId 60458: BeforeJob: rsync: link_stat
>>>>>>> "/home/bacula/bacula.sql" failed: No such file or directory (2)
>>>>>>> 03-Jan 18:09 backup-dir JobId 60458: BeforeJob: rsync error: some
>>>>>>> files could not be transferred (code 23) at main.c(977) [sender=2.6.9]
>>>>>>> 03-Jan 18:09 backup-dir JobId 60458: Error: Runscript: BeforeJob
>>>>>>> returned non-zero status=23. ERR=Child exited with code 23
>>>>>> but all-other-admins get only this line in the mail
>>>>>>
>>>>>>> 03-Jan 18:09 backup-dir JobId 60458: Error: Runscript: BeforeJob
>>>>>>> returned non-zero status=23. ERR=Child exited with code 23
>>>>>> why sends "warning, error, fatal, terminate" only the last line?
>>>>> See above. If you want all the messages included in the email, add ALL.
>>>>>
>>>>>> i see the whole problem in the mail, my team mates have to look at the
>>>>>> backup job log to see the real failure.
>>>>>> can i change behaviour this by changing the configuration?
>>>>> You have not stated it, but I *think* want you want to have happen is an
>>>>> email sent to all-other-admins AT ic3s DOT de ONLY if the email contains a
>>>>> "warning, error, fatal, terminate" message.
>>>>>
>>>>> Check the docs, I don't know how to do this myself.  But if the code
>>>>> cannot do this, I suggest procmail may be of help.
>>>> the keywords warnig, error, fatal, ... only describe the message level
>>> the persons get,
>>>> but why is the content different?
>>> The content is different because you specified what messages you want to
>>> appear in that email.  The setting in question does not say: send me an
>>> email only if the LEVEL is above a certain setting.  It says: send me
>>> any messages which are of these LEVELs.
>>>
>>> Please consider this carefully: The email you receive contains messages.
>>>  You specify what messages should appear in the email.  You are not
>>> specifying that you want to be notified ONLY if errors occur, for example.
>>>
>>>> if i get a fatal message because of i get "all" messages
>>>> why i get more content/information in the mail than all-other-admins?
>>>> (they get the fatal message because of they get messages with level
>>> "fatal")
>>>
>>> Because you said *you* want ALL messages (NOTE: message != email).  An
>>> email contains messages.  Do not confuse the two.
>>>
>>>> if i change all-other to level "all"
>>>> they will get all messages, including: backup of xxxx ok .....
>>>> thats not really what i want.
>>> This is where procmail may help you.  Or perhaps someone else has a good
>>> idea.
> 

-- 
[:O]###[O:]

------------------------------------------------------------------------------
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
_______________________________________________
Bacula-users mailing list
Bacula-users AT lists.sourceforge DOT net
https://lists.sourceforge.net/lists/listinfo/bacula-users