Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
[nagios@vps ~]$ sudo /usr/local/nagios/libexec/check_nrpe -H localhost -c check_asterisk_peers
Sorry, user nagios is not allowed to execute '/usr/local/nagios/libexec/check_nrpe -H localhost -c check_asterisk_peers' as root on vps.domain.tld.
So how do I correctly give the nagios-user root-rights to be able to execute "nagisk.pl -c peers" ?? Without manually having to give the sudo-command...
Last edited by jonaskellens; 11-06-2009 at 09:59 AM.
You seem to be implying that the check_asterisk_peers check in NRPE is calling the /usr/local/nagios/libexec/nagisk.pl script.
Is this the case? Is check_asterisk_peers a script? If so you'd need to insert the sudo into the line of the script that is calling /usr/local/nagios/libexec/nagisk.pl.
You do NOT need to do sudo to check_npre. It won't work (and didn't as you show) because you never granted permission to do check_nrpe in sudo. It is NOT necessary to do such a grant because you're running the check_nrpe as nagios user which is the default user.
That is to say you've granted permission to one thing (/usr/local/nagios/libexec/nagisk.pl) but then try to run something else (check_nrpe) with sudo.