|
Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com |
From: Bill Cole (postfixlists-070913
billmail.scconsult.com)
Date: Wed Oct 10 2007 - 09:44:42 CDT
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
At 4:20 PM +0200 10/10/07, Jasper Jans imposed structure on a stream
of electrons, yielding:
>Hello,
>
>I'm sorry if this is OT in advance..
>
>I've seen plenty of scripts out in the wild that track the mail
>logfile and present either realtime
>counters or graphs on performance (connections, bounce, denied,
>spam, virus, etc). I'm dealing
>with a relatively high volume site and on top of these I'd also like
>to see things like the size of the
>mail queue.
>
>The problem I'm facing here is that "postqueue -p | tail -1" should
>normally return within a
>few seconds since the queues should not be too full - however if we
>hit some problems
>the queues can fill up real fast and this command will start to take
>longer than the monitoring
>interval - not to mention the fact that each time you execute this
>it add to the disk i/o which
>on times of problems is already high.
>
>One thing I came up with is to write a script that queries the mail
>queue size say once an hour
>via postqueue -p and on top of that track the amount of mails that
>come in and go out of the
>system by means of a tail on the maillog to give me an estimated
>value on the size of the queue
>at any moment in time. I realize this has a certain amount of error
>in it - but it will tell me if the
>queues are at 10 or 1000 or maybe even 10000000 emails.
>
>How are other people handling this?
If all you want is a count of the queue without internal mail detail,
you will probably find more efficiency by looking at the queue from
the perspective of the filesystem rather than from the perspective of
Postfix itself. For example, you might use this as a starting point:
find /var/spool/postfix/*/?/ -type f -name ???????????
That is likely to run a little faster than postqueue -p, and will
give you a much simpler and smaller batch of text to parse than the
mail log.
--
Bill Cole
bill
scconsult.com
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]