Try logging in to the remote system and change to the nrpe user by running
- Code: Select all
su nrpe
Then run the command that you have defined in the nrpe.cfg line the example below.
- Code: Select all
/usr/bin/sudo /usr/local/nagios/libexec/check_swap -w 20% -c 10%
You will probable see and error similar to below.
Sorry, user nrpe is not allowed to execute '/usr/local/nagios/libexec/check_swap -w 20% -c 10%' as root on localhost.localdomain.
If you see that error, try running it without sudo in the command like the following
- Code: Select all
/usr/local/nagios/libexec/check_swap -w 20% -c 10%
If it works, remove the /usr/bin/sudo from your commands and that should fix it for you.
One thing to note, you are running the agent as the nrpe user and the plugins are installed as the nagios user account.
You may have to adjust the owner of the plugins to the nrpe user to get them to function.