|
Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com |
Re: Postfix log consolidation
From: Bill Anderson (bill
noreboots.com)
Date: Tue Jan 16 2007 - 09:41:26 CST
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On Tuesday 16 January 2007 07:17, Greg Wetmore wrote:
> > > Unfortunately (at least at default verbosity), there does not seem to
> > > be a definitive log event that can be used to detect this situation.
> >
> > to detect what? that message was "completed"? qmgr says something like
> > this:
> >
> > ... postfix/qmgr[1016]: 123456789A: removed
> >
> > > Has anyone attempted something like this?
> > > Is it even possible when factoring in the asynchronous behaviour of
> > > delivery attempts in a loaded system?
> >
> > Parsing logs is possible. asking logs to lie (say "completed" when it is
> > not yet) is not possible.
>
> Unfortunately, this line is not always present to signal that postfix
> is finished active processing on a message. If any recipients are
> deferred, this line does not appear, yet the message is out of the
> active queue. This is really what I want to detect.
My solution:
I developed a daemon that monitors the filesystem activity using the Linux 2.6
kernel inotify system to monitor when files are moved around in the queue
directories. In my case it reports changes via a spread channel and all
interested applications monitor the spread channel.
I'm originally developed it for near-real-time queue monitoring. I found that
tracking entries/exists, analyzing a queue file (ie. via postcat) once upon
system entry, and reporting the data via a spread publish works a helluva lot
faster than chugging through the mailq output or descending directories for
frequent analysis.
However, there is no reason I can see that such a system isn't useful for what
you are describing. Simply use inotify to monitor the active queue's
directory for 'deletions' and log it to the maillog.
Cheers,
Bill
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]