LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Sudoers issue (https://www.linuxquestions.org/questions/linux-software-2/sudoers-issue-4175460560/)

glennbtn 05-03-2013 06:59 AM

Sudoers issue
 
Hi All

I have added a file to sudoers using visudo so that a plugin can be run.

nagios All=(ALL) NOPASSWD: /usr/local/nagios/libexec/check_md_raid

When the plug in called remotely from nagios the returned result is

UNKNOWN: You must be root to run this plugin

Can anyone help here please

Thanks

Glenn

acid_kewpie 05-03-2013 07:34 AM

it sounds like you're not actually using sudo in the command.

You should be running these commands under sudo though. if you REALLY need to, then you should actually update the script and run the specific command in the script to use sudo. That way you don't need to embed the sudo optiosn in your nagios config files either.

sundialsvcs 05-03-2013 07:51 AM

Urgh. The thought of running a Sudo-level command through Nagios stinks to me.

glennbtn 05-03-2013 07:58 AM

Thanks for the reply

So how would I add this in the nrpe.cfg file as I can't seem to get it to work. My original command was

command[check_md_raid]=/usr/local/nagios/libexec/check_md_raid

Thanks

Glenn

acid_kewpie 05-04-2013 01:47 AM

Quote:

Originally Posted by sundialsvcs (Post 4944094)
Urgh. The thought of running Nagios stinks to me.

Fixed that for you :)

---------- Post added 04-05-13 at 07:48 AM ----------

Quote:

Originally Posted by glennbtn (Post 4944097)
Thanks for the reply

So how would I add this in the nrpe.cfg file as I can't seem to get it to work. My original command was

command[check_md_raid]=/usr/local/nagios/libexec/check_md_raid

Thanks

Glenn

don't change that. change the check_md_raid script itself.


All times are GMT -5. The time now is 08:02 PM.