Quotation from /usr/share/doc/nagios-nrpe-2.12-r102/SECURITY :
To enable support for command argument in the daemon, you must
do two things:
1. Run the configure script with the --enable-command-args
2. Set the 'dont_blame_nrpe' directive in the NRPE config
file to 1.
Now, let's emerge nagios-nrpe:
FEATURES="keeptemp" USE="-command-args" emerge -av1 nagios-nrpe
# grep command-args /var/tmp/portage/net-analyzer/nagios-nrpe-2.12-r102/temp/build.log
./configure --prefix=/usr --build=i686-pc-linux-gnu --host=i686-pc-linux-gnu --mandir=/usr/share/man --infodir=/usr/share/info --datadir=/usr/share --sysconfdir=/etc --localstatedir=/var/lib --enable-ssl --disable-command-args --host=i686-pc-linux-gnu --prefix=/usr --libexecdir=/usr/lib/nagios/plugins --localstatedir=/var/nagios --sysconfdir=/etc/nagios --with-nrpe-user=nagios --with-nrpe-grp=nagios
As we can see, aplication was configured without command-args.
Edit /etc/nagios/nrpe.cfg and change:
dont_blame_nrpe=0 to dont_blame_nrpe=1
and let's add line:
command[check_test]=/bin/echo " -w $ARG1$ -c $ARG2$ -s $ARG3$"
Starting nrpe daemon:
# /etc/init.d/nrpe start
And now i'm checking nrpe via check_nrpe:
# /usr/lib/nagios/plugins/check_nrpe -H 127.00.0.1 -c check_test -a FOO BAR TEST
-w FOO -c BAR -s TEST
It's no matter if nrpe is compiled with or without command-args, this is always enabled.
Created attachment 207552 [details]
Ping, first birthday of bug, without any answer :/
i'll take a look at it within the next few days ..
(In reply to comment #3)
> i'll take a look at it within the next few days ..
Verified. Removed the command-args use-flag in -r104.
I am having problems with net-analyzer/nagios-nrpe-2.12-r104. I noticed the use flag "command-args" has been removed. After updating to the new version and restarting the nrpe service, I am getting the following errors:
nrpe: Error: Request contained command arguments!
nrpe: Client request was invalid, bailing out...
Did you only test locally (check_nrpe -H 127.00.0.1 ...) or did you actually connect from a remote nagios host through port 5666 ? I think this will make a huge difference.
So please reenable the use flag "command-args"!!!
(In reply to comment #5)
> Did you only test locally (check_nrpe -H 127.00.0.1 ...)
Obviously :/ Lemme re-check tomorrow.
(In reply to comment #5)
> I am having problems with net-analyzer/nagios-nrpe-2.12-r104. I noticed the use
> flag "command-args" has been removed. After updating to the new version and
> restarting the nrpe service, I am getting the following errors:
# COMMAND ARGUMENT PROCESSING
# This option determines whether or not the NRPE daemon will allow clients
# to specify arguments to commands that are executed. This option only works
# if the daemon was configured with the --enable-command-args configure script
So please readd useflag to allow arguments for nrpe ;)
It looks that I unwitting made muddle. I'm sorry for it.
-r104 removed and -r103 restored.