check_mailq exim patch and instructions...

Jim Mozley jim.mozley at exponential-e.com
Tue Dec 2 22:36:57 CET 2003


I search the archives for "exim" looking for a queue checking plugin and used
some of this below. I think that the pattern match:

if (//0// ) {

is incorrect.

It should be something like /^0/ as otherwise a message queue of, for instance,
105 messages is treated as an empty mail queue, which is probably not what was
intended.

Jim


>I wanted check_mailq to work with *exim* and a quick modification to the code
>was all that was needed.  I was unable to find any info on this but it
>works.  Let me know if theres any questions/problems.
>
>INSTRUCTIONS
>1. touch /usr/bin/mailq
>2. echo -e '#!/bin/sh\n/usr/sbin/*exim* -bpc' > /usr/bin/mailq
>3. cd /usr/local/nagios/libexec
>4. touch check_mailq.patch
>5. Copy and paste the code below into this file
>6. patch -p0 < check_mailq.patch
>7. dont forget to edit utils.pm and set the mailq path to /usr/bin/mailq
>
>
>-------------------PATCH CUT BELOW-----------------------------
>--- check_mailq Thu Oct  2 22:29:18 2003
>+++ check_mailq.*exim*patch       Thu Oct  2 22:32:33 2003
> <at>  <at>  -67,9 +67,8  <at>  <at> 
>
> # only first line is relevant in this iteration.
> while (<MAILQ>) {
>-       if (//mqueue//) {
>                print "$utils::PATH_TO_MAILQ = $_ "if $verbose ;
>-               if (//empty// ) {
>+               if (//0// ) {
>                        $msg = "OK: mailq is empty";
>                        $msg_q = 0;
>                        $state = $ERRORS{'OK'};
> <at>  <at>  -89,7 +88,6  <at>  <at> 
>                                $state = $ERRORS{'CRITICAL'};
>                        }
>
>-               }
>
>                last;
>        }
>--------------------END CUT---------------------------------------
>
>
> <http://www.cPlicensing.net>

 <http://www.cPlicensing.net>



-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive?  Does it
help you create better code?  SHARE THE LOVE, and help us help
YOU!  Click Here: http://sourceforge.net/donate/
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null





More information about the Users mailing list