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)


It seems to me that you don't have the "requiretty" line in your sudoers files, make sure you have the following line there:

Defaults:nagios !requiretty

It's meaning is that nagios user (only) is not required to have a tty to run a command which is why I suspect your command fails.

If you're not sure which user runs nagios you can check it in the configuration file which is usually located in /etc/nagios/nrpe.cfg.

If I had experienced this issue I'd want to first make sure that nagios user is able to successfully run the command and in order to do that I'd enable nagios user's ability to log into the machine by editing it's line in /etc/passwd from:




Then, I'd su - nagios to continue my troubleshooting and then, after solving the issue I'd change this line back to /bin/false.


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.

  • 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.

  • 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

Possibly problem with nagios user. Please check whether nagios user have rights to execute the plugins or not.
plugin permissions shoud be like :

 rwxr-xr-x 1 nagios nagios 163831 May 30  2016 check_users

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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