Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Right to the point.

NRPE.CFG Modifications:

Added Nagios Host to Allowed:


Removed # in front of command_prefix=/usr/bin/sudo

After that i have reloaded the service.

/etc/init.d/nagios-nrpe-server restart

I have also edited /etc/sudoers

# User privilege specification
root    ALL=(ALL:ALL) ALL
nagios  ALL=NOPASSWD: /usr/lib/nagios/plugins/


$ ./check_users -w 5 -c 10
USERS OK - 1 users currently logged in |users=1;5;10;0

Works and i get my results


su nagios -c "./check_users -c 2 -w 2"

Resolves in nothing.

From the Nagios host to the new remote system i can run:

check_nrpe -H

And i get NPRE v2.12 as result.

I have checked so to that Nagios is owner to the plugin folder but still no go.

Any tips would be helpful.

(and yes i have googled and read a 10-20 threads but still no go)

share|improve this question

Please, check if the nrpe process is exactly killed when you restart the service. I used to have the same issue. Use:

ps -ef | grep nrpe

to check if the process is still runnning and then:

kill -9 `ps -ef | grep nrpe | awk '{print $2}'`

command to kill it manually.

share|improve this answer
Thanks for the suggestion but sadly it was restarted as it should with the restart command. – WebFooL Mar 1 '13 at 13:58

Are you able to successfully execute the check_users with sudo (as the user running nrpe)? ie.

sudo ./check_users -c 2 -w 2

By any chance, does CentOS have requiretty at the top of the sudoers file? If so, that's the likely culprit. You could try temporarily disabling it globally, or just disable it for the nagios user.

share|improve this answer
No that is the problem. The Nagios User it the user running the NRPE and when i su at it i can't run the command. But if I run it as a local user user without sudo it works. BTW i am running Ubuntu 12.04. – WebFooL Mar 4 '13 at 7:22

Your Answer


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.