Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

After reading this

[root@wcmisdlin02 alexus]# tail -2 /etc/sudoers
## Read drop-in files from /etc/sudoers.d (the # here does not mean a comment)
#includedir /etc/sudoers.d
[root@wcmisdlin02 alexus]# 

I now have following:

[root@wcmisdlin02 ~]# cat /etc/sudoers.d/01_nagios 
Defaults:nagios !requiretty
nagios      ALL=(ALL)   NOPASSWD:   /usr/lib/nagios/plugins/
[root@wcmisdlin02 ~]# 

yet I'm getting in my /var/log/messages

Sep 21 11:14:32 wcmisdlin02 sudo:     nrpe : sorry, you must have a tty to run sudo ; TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/usr/lib/nagios/plugins/check_load -w 6,5,4 -c 8,7,6

What am I doing wrong?

share|improve this question

1 Answer 1

up vote 2 down vote accepted

Make sure that NRPE is running as nagios user.

If you run it as a standalone service:

ps -ef | grep nrpe
grep nrpe_user /path/to/nrpe.cfg

Or if you run it via TCP wrapper:

grep user /etc/xinetd.d/nrpe
share|improve this answer
    
you were right, new nagios's nrpe now uses nrpe user instead of nagios user, so as soon as i changed nagios to nrpe it start working right away, thanks! –  alexus Sep 21 '11 at 15:36
    
@alexus If this solution works please accept the answer :-) –  voretaq7 Sep 21 '11 at 15:41
    
@voretaq7 I was trying to do so, it wouldn't allow me to do so, it said it was too soon, i gotta wait for 2 minutes, so now after 2 minutes later i accept it as an answer –  alexus Sep 21 '11 at 15:42
    
ah, I forgot about that timeout :-) –  voretaq7 Sep 21 '11 at 15:46

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.