Valid command_line directories

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
Pastey
Posts: 1
Joined: Fri Nov 09, 2012 4:11 pm

Valid command_line directories

Post by Pastey »

I have a:

Code: Select all

command_line /usr/bin/ssh ...
When I run a job using that command line I get
(Return code of 126 is out of bounds - plugin may not be executable)
I issue the command (as root):

Code: Select all

cp /usr/bin/ssh /usr/local/bin
change the command to

Code: Select all

command_line /usr/local/bin/ssh ...
and reload; no other changes. Now it works. I've tried this with many different directories and /usr/lib64/nagios/plugins, /usr/lib64/nagios/plugins/local (I created) work; what (if anything) else might work? I know this may be a Red Hat configure choice or packaging issue; if so and someone knows, please let me know.

Thanks.
User avatar
jsmurphy
Posts: 989
Joined: Wed Aug 18, 2010 9:46 pm

Re: Valid command_line directories

Post by jsmurphy »

While I don't actually know why this is happening, I would consider this a feature not a bug.

You should not be allowed to execute any of the default *nix bin directories with the NRPE agent considering it can be used to execute arbitrary commands (particularly when args are enabled). Even in a secure walled off environment that's still a pretty major security no-no.

If I was forced to guess... I would probably say the NRPE agent is probably coded to block access as a safety precaution.
Locked