[Nagiosplug-devel] check_mailq Option Parsing Error

Adam Vollrath adam at endpoint.com
Wed May 12 10:28:37 CEST 2010


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.

Thank you for your consideration,
Adam Vollrath
End Point Hosting Team
http://www.endpoint.com/



More information about the Devel mailing list