NRPE Not Working
NRPE Not Working
I am using NRPE and have created a number of custom commands. I distributed the nrpe.cfg file and all seems to work fine with the exception of displaying the correct information in the browser when using Nagios. I can access and run the check_nrpe command successfully from the server to the remote system (i.e. check_nrpe -H <host> -c ,custom command>) and receive a successful message (i.e. OK, WARNING, CRITICAL, etc.). But Nagios does not display this information correctly and instead displays the following "Return code of 127 is out of bounds - plugin may be missing". I can run the command on the remote system (i.e. <custom command>) and on the server as listed above and both work fine. But I can't seem to get the web app to display the correct info. Any ideas?
Re: NRPE Not Working
Usually this is related to permissions and the nagios user not being able to access the plugin. What are the permissions of the check_nrpe file? ls -la check_nrpe
Additionally, is your custom plugin using exit codes to exit properly? For example - exit 0 (as an OK status)
Additionally, is your custom plugin using exit codes to exit properly? For example - exit 0 (as an OK status)
Former Nagios Employee
Re: NRPE Not Working
What user are you running this as on the terminal of your Nagios server?
Former Nagios Employee.
me.
me.
Re: NRPE Not Working
The owner/permissions on check_nrpe were root/755. All the other plugins were nagios/755. Not sure how this happened but the permissions should have allowed this to work. I changed check_nrpe to nagios/755. As for the custom commands, they are merely common plugins with different arguments (i.e. check_mydisk = check disk ... /dev/mydisk).
Even after changing permission on check_nrpe it still gives the same errors.
Even after changing permission on check_nrpe it still gives the same errors.
Re: NRPE Not Working
The other strange thing is that I have a number of custom commands defined. One of them works and some of the others do not.
Re: NRPE Not Working
Can you show us the actual check that you are running from the command line on the Nagios server, along with the output of it? Run the check twice, once as root, and once as nagios user.
Also, show us how the command is defined in the nrpe.cfg on the remote box.
Also, show us how the command is defined in the nrpe.cfg on the remote box.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: NRPE Not Working
I am using the generic check_disk plugin with -w, -c and -p arguments such as:
command[check_disk1]=/path/to/plugins/check_disk -w 10% -c 5% -p disk1
command[check_disk2]=/path/to/plugins/check_disk -w 10% -c 5% -p disk2
command[check_disk3]=/path/to/plugins/check_disk -w 10% -c 5% -p disk3
etc.
I am also doing the same for custom commands utilizing the check_load plugin.
command[check_disk1]=/path/to/plugins/check_disk -w 10% -c 5% -p disk1
command[check_disk2]=/path/to/plugins/check_disk -w 10% -c 5% -p disk2
command[check_disk3]=/path/to/plugins/check_disk -w 10% -c 5% -p disk3
etc.
I am also doing the same for custom commands utilizing the check_load plugin.
Re: NRPE Not Working
On the remote machine, as the nagios user, are you able to run /path/to/plugins/check_disk -w 10% -c 5% -p disk1 and have it return the expected output?troche wrote:I am using the generic check_disk plugin with -w, -c and -p arguments such as:
command[check_disk1]=/path/to/plugins/check_disk -w 10% -c 5% -p disk1
command[check_disk2]=/path/to/plugins/check_disk -w 10% -c 5% -p disk2
command[check_disk3]=/path/to/plugins/check_disk -w 10% -c 5% -p disk3
etc.
I am also doing the same for custom commands utilizing the check_load plugin.
Former Nagios Employee
Re: NRPE Not Working
Yes, as both the nagios and root users.
Re: NRPE Not Working
Can you show us the actual commands? We need to make sure that your command is configured properly, your paths are correct, etc. Here's an example:
On the client (remote machine)
- the "df -h" output
- command run locally on the client
- command definition
On the nagios server
On the client (remote machine)
- the "df -h" output
Code: Select all
[root@192 ~]# df -h
Filesystem Size Used Avail Use% Mounted on
rootfs 9.4G 6.8G 2.6G 73% /
devtmpfs 2.0G 140K 2.0G 1% /dev
tmpfs 2.0G 0 2.0G 0% /dev/shm
/dev/sda1 9.4G 6.8G 2.6G 73% /Code: Select all
[root@192 ~]# /usr/local/nagios/libexec/check_disk -w 10% -c 5% -p /
DISK OK - free space: / 2637 MB (27% inode=82%);| /=6877MB;8650;9131;0;9612Code: Select all
command[check_disk_new]=/usr/local/nagios/libexec/check_disk -w 10% -c 5% -p /Code: Select all
[root@localhost tmp]# /usr/local/nagios/libexec/check_nrpe -H <client ip> -c check_disk_new
DISK OK - free space: / 2637 MB (27% inode=82%);| /=6877MB;8650;9131;0;9612Be sure to check out our Knowledgebase for helpful articles and solutions!