Re: [Nagios-devel] check_nrpe parses arguments to -a (with fix)

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
Guest

Re: [Nagios-devel] check_nrpe parses arguments to -a (with fix)

Post by Guest »


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: [email protected]
Web: www.nagios.org





This post was automatically imported from historical nagios-devel mailing list archives
Original poster: [email protected]
Locked