Patch for check_mailq options processing errors

Michael Batchelor mike.batchelor at ticketmaster.com
Sat Sep 15 02:18:48 CEST 2007


I tried using the -W and -C options to check_mailq and discovered that
the options processing function has some errors that make these options
non-functional.  I've attached a patch to fix those errors and make the
script behave the way the usage() function describes. The code for the
detailed checks on the queues works, but due to the faulty options
processing I could not use them without this patch.

Usage: check_mailq -w <warn> -c <crit> [-W <warn-detailed>] [-C
<crit-detailed>] [-M <MTA>] [-t <timeout>] [-v verbose]

   Checks the number of messages in the mail queue (supports multiple
sendmail queues, qmail)
   Feedback/patches to support non-sendmail mailqueue welcome

-w (--warning)       = Min. number of messages in queue to generate
warning
-c (--critical)      = Min. number of messages in queu to generate
critical alert ( w < c )
-W (--warn-detailed) = Min. number of messages for same domain in queue
to generate warning
-C (--crit-detailed) = Min. number of messages for same domain in queue
to generate critical alert ( W < C )
-t (--timeout)       = Plugin timeout in seconds (default = 15)
-M (--mailserver)    = [ sendmail | qmail | postfix | exim ] (default =
sendmail)
-h (--help)
-V (--version)
-v (--verbose)       = debugging output

Note: -w and -c are required arguments.  -W and -C are optional.
 -W and -C are applied to domains listed on the queues - both FROM and
TO. (sendmail)
 -W and -C are applied message not yet preproccessed. (qmail)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: check_mailq.diff
Type: application/octet-stream
Size: 4007 bytes
Desc: check_mailq.diff
URL: <https://www.monitoring-lists.org/archive/developers/attachments/20070914/ffeff83b/attachment.obj>
-------------- next part --------------
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
-------------- next part --------------
_______________________________________________
Nagios-devel mailing list
Nagios-devel at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-devel


More information about the Developers mailing list