[Nagiosplug-devel] check_mailq Option Parsing Error

Thomas Guyot-Sionnest dermoth at aei.ca
Wed May 12 12:05:32 CEST 2010


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 10-05-12 04:28 AM, Adam Vollrath wrote:
> Briefly,
> 
> I believe I've found an option parsing bug in `check_mailq`.  #nagios on freenode says this is the place to report it.
> 
> The help output says it accepts -W and -C for domain-specific warning/crit levels, but the options parser doesn't accept those arguments.  When specified at the command line, the following output is observed:
> 
> # /usr/lib/nagios/plugins/check_mailq -w 350 -c 500 -W 10 -C 50
> Unknown option: W
> Unknown option: C
> OK: mailq is empty|unsent=0;350;500;0
> # echo $?
> 0
> 
> I do see opt_W and opt_C defined and invoked several places throughout the script (in addition to opt_c and opt_w).  The fault begins in `sub process_arguments()` where the `GetOptions()` call does not specify -W or -C.  I made a trivial patch here to include them that seemed to work, but I didn't extensively test if these thresholds were properly tested.

I'm not even sure this feature works properly or as advertised. The help
output would have to be changed anyway because --Warning is the same as
- --warning (so using the -- format does actually nothing)!

I would have to look deeper at it... The related code block looks for
preprocessed messages.

- -- 
Thomas
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkvqfWEACgkQ6dZ+Kt5Bcha4HACg/1SIAMYUgJA9uqVSoEJg8Z2p
Pn0AmgPCRLuZHwmWhniT6zoaj7StL3ch
=+s4m
-----END PGP SIGNATURE-----




More information about the Devel mailing list