nrpe and sudo
Terry
td3201 at gmail.com
Thu Aug 7 18:35:16 CEST 2008
On Thu, Aug 7, 2008 at 11:11 AM, Sean McAfee
<smcafee at collaborativefusion.com> wrote:
>
> Terry wrote:
>>
>> Hello,
>>
>> I am trying to run sudo /usr/sbin/clustat -s $service -l from nrpe.
>> I can run it on the nrpe machine as the nagios user and it works fine.
>> However, when I call it from my nagios machine via check_nrpe it is
>> not working. Since sudo works locally, it is something with nrpe in
>> how it is calling the sudo command that is making sudo not match. my
>> sudoers is pretty open as it sits right now for testing:
>> nagios ALL=(ALL) NOPASSWD: ALL
>>
>> I even broke it down to a very simple script:
>> #!/usr/bin/perl
>>
>> use lib "/usr/lib64/nagios/plugins";
>> use utils qw(%ERRORS);
>> $command = "sudo /bin/echo shit";
>> $foo = `$command`;
>> print "$foo\n";
>> exit $ERRORS{'OK'};
>>
>> I get this from the other side:
>> CHECK_NRPE: No output returned from daemon.
>>
>> I see that you can prefix all commands with sudo in the nrpe.cfg but I
>> only need it for a few plugins so would rather just call it from the
>> script.
>
> Try specifying the full path to sudo.
>
> Sean McAfee
> System Engineer
>
> Collaborative Fusion, Inc.
> smcafee at collaborativefusion.com
> 412-422-3463 x 4025
>
> 5849 Forbes Avenue
> Pittsburgh, PA 15217
>
Good catch but that's not it. :(
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue.
::: Messages without supporting info will risk being sent to /dev/null
More information about the Users
mailing list