check_nrpe parses arguments to -a (with fix)

Ethan Galstad nagios at nagios.org
Sun Apr 13 19:49:50 CEST 2008


John Sellens wrote:
> check_nrpe parses arguments to the -a option, which it
> shouldn't, since those args are for the remote plugin,
> not for check_nrpe itself.
> 
> Repeat by:
>     /usr/local/libexec/nagios/check_nrpe -H one -c hello -a there -V
> which will likely complain about -V being invalid.
> 
> I ran into this when I was trying to do an indirect check_http:
>     check_nrpe -H gatehost -c check_http -H webhost
> and noticed that check_nrpe was trying to connect to webhost
> and not gatehost.
> 
> Here's a quick diff to src/check_nrpe.c that stops parsing args
> once it finds -a, and also adds the -V option to the getopt args.
> 
> Thanks - cheers!
> 
> John

You can avoid this problem by quoting any arguments passed with the -a
option:

./check_nrpe -H one -c hello -a "opt1 -V opt2 -xyz opt3"




Ethan Galstad
Nagios Developer
___
Email: nagios at nagios.org
Web:   www.nagios.org

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone




More information about the Developers mailing list