2

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?

squillman
  • 37,883
  • 12
  • 92
  • 146
alexus
  • 13,112
  • 32
  • 117
  • 174

1 Answers1

2

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
quanta
  • 51,413
  • 19
  • 159
  • 217
  • 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
  • @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