On Fri, 19 May 2006 23:29:02 -0400,
<munin-users-request@...> wrote:
> Send munin-users mailing list submissions to
> munin-users@...
>
> To subscribe or unsubscribe via the World Wide Web, visit
> https://lists.sourceforge.net/lists/listinfo/munin-users
> or, via email, send a message with subject or body 'help' to
> munin-users-request@...
>
> You can reach the person managing the list at
> munin-users-admin@...
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of munin-users digest..."
>
>
> Today's Topics:
>
> 1. Qmail Queue plugin? (Adam bultman)
> 2. Re: Qmail Queue plugin? (Lupe Christoph)
> 3. Re: Qmail Queue plugin? (Adam bultman)
>
> --__--__--
>
> Message: 1
> Date: Thu, 18 May 2006 13:27:52 -0800
> From: Adam bultman <adamb@...>
> To: munin-users@...
> Subject: [munin-users] Qmail Queue plugin?
>
> I just joined the list, so I apologize if this has been done, but I
> hacked the postfix mailqueue plugin to check the queue on my qmail
> server.
>
> It checks the various directories in $QUEUEDIR and reports back with
> numbers.
> I just made some more changes, but it seems to be working just fine on
> our qmail server. Sadly, it doesn't check for the existence of a queue
> directory because of the wacky permissions that qmail likes to put on
> it's queue dir. In a similar poor vein, the qmail queue checker requires
> sudo permissions for the munin user:
> munin ALL=(qmailq,qmails) NOPASSWD: /usr/bin/find
>
> "Find" has the ability to execute commands, which is bad - but this is
> the best I could do in the time slot I wanted to allot for this. If you
> have adjustments, lemme know.
>
> Adam
>
>
> <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
> #!/bin/sh
> #
> # Plugin to monitor qmail mail queue
> #
> # Contributed by Adam bultman
> # http://www.glaven.org/
> #
>
> # Can be set via environment, but default is /var/qmail/queue
> QUEUEDIR=${queuedir:-/var/qmail/queue}
>
> # Postfix mqueue management: http://www.postfix.cs.uu.nl/queuing.html
> # local: Processed mail that is queued for local delivery.
> # remote: Processed mail that is queued for remote delivery.
> # bounce: Processed mail that is queued for bouncing.
> # todo: Not yet Processed mail to be queued for delivery..
> # total: Total mail in queue, as found in $QMAILQUEUE/mess
>
> # Requires this in /etc/sudoers:
> # munin ALL=(qmailq,qmails) NOPASSWD: /usr/bin/find
> # If there's a safer way, I'm sure we can do that.
>
> case $1 in
> autoconf|detect)
> if [ -d $QUEUEDIR/ ] ; then
> echo yes
> exit 0
> else
> echo "no (queuedir not found)"
> exit 1
> fi;;
> config)
> cat <<'EOF'
> graph_title Qmail Mailqueue
> graph_vlabel Mail in queue
> graph_category qmail
> graph_total Total
> local.label Local Delivery Queue
> remote.label Remote Delivery Queue
> bounce.label Bounce Delivery Queue
> todo.label Mail Not Pre-processed
> total.label Total Queue Size
> EOF
> exit 0;;
> esac
>
> cat <<EOF
> local.value `(sudo -u qmails find $QUEUEDIR/local -type f) | wc -l`
> remote.value `(sudo -u qmails find $QUEUEDIR/remote -type f) | wc -l`
> bounce.value `(sudo -u qmails find $QUEUEDIR/bounce -type f) | wc -l`
> todo.value `(sudo -u qmailq find $QUEUEDIR/todo -type f) | wc -l`
> total.value `(sudo -u qmailq find $QUEUEDIR/mess -type f) | wc -l`
> EOF
>
>
> >>>>>>>>>>>>>>>>>>>>>>>>>>>
>
>
>
> --__--__--
>
> Message: 2
> Date: Fri, 19 May 2006 14:32:44 +0200
> To: Adam bultman <adamb@...>
> Cc: munin-users@...
> Subject: Re: [munin-users] Qmail Queue plugin?
> From: lupe@... (Lupe Christoph)
>
> On Thursday, 2006-05-18 at 13:27:52 -0800, Adam bultman wrote:
>> I just joined the list, so I apologize if this has been done, but I
>> hacked the postfix mailqueue plugin to check the queue on my qmail
>> server.
>
> There is no qmail plugin in the SVN repository. I have to admit I'm too
> lazy to check trac.
>
>> It checks the various directories in $QUEUEDIR and reports back with
>> numbers.
>> I just made some more changes, but it seems to be working just fine on
>> our qmail server. Sadly, it doesn't check for the existence of a queue
>> directory because of the wacky permissions that qmail likes to put on
>> it's queue dir.
>
> I don't understand what you mean here. The autoconf does check for
> -d $QUEUEDIR/
>
>> In a similar poor vein, the qmail queue checker requires
>> sudo permissions for the munin user:
>> munin ALL=(qmailq,qmails) NOPASSWD: /usr/bin/find
>
> I wonder why you can't use this in a plugin-conf file:
> [qmail*]
> user qmail
> group qmail
>
>> "Find" has the ability to execute commands, which is bad - but this is
>> the best I could do in the time slot I wanted to allot for this. If you
>> have adjustments, lemme know.
>
> I'm no sudo expert, and I'd rather not use sudo at all. But I believe
> you can restrict the arguments as well in the sudoers file.
>
> HTH,
> Lupe Christoph
--
Bill Thielman
"Words are the keys to the heart."
-- Chinese proverb
http://www.i-t-publishing.com
IT Marketing Ltd
|