Issues with Nagios NRPE monitoring (Return code of 127 is out of bounds - plugin may be missing)
Hello,
I'm at my wits' end trying to fix my Nagios server's issue. I've followed the NRPE documentation closely, but I'm still getting this same error: (Return code of 127 is out of bounds - plugin may be missing) in the Nagios web service. When I run the command
from the terminal, I receive the expected output. Not so much with what's inside my configuration files.
My setup is a LAN virtualized using VMWare Workstation. The monitoring and monitored machines are connected through a LAN segment, both running the latest version of CentOS 6.
Config files in regards to NRPE are as follows:
linux.cfg
define host{ use remote-linux-server ; Name of host template to use ; This host definition will inherit all variables that are defined ; in (or inherited by) the linux-server host template definition. host_name linux alias Linux Server address 10.254.1.2 }define service{ use generic-service ; Name of service template to use host_name linux service_description CPU Load check_command check_nrpe!check_load }define hostgroup{ hostgroup_name remote-linux-servers ; The name of the hostgroup alias Remote Linux Servers ; Long name of the group members linux ; Comma separated list of hosts that belong to this group }define service{ use generic-service host_name linux service_description Ping check_command check_ping!100.0,20%!500.0,60% }
service nrpe{ flags = REUSE socket_type = stream port = 5666 wait = no user = nagios group = nagios server = /usr/local/nagios/bin/nrpe server_args = -c /usr/local/nagios no only_from = 10.254.1.1}
I am not sure if its because of the format when pasting code, but your /etc/xinetd.d/nrpe file does not look correct. Here is a copy of mine from a working server that runs check_load
# default: on
# description: NRPE (Nagios Remote Plugin Executor)
service nrpe
{
flags = REUSE
socket_type = stream
port = 5666
wait = no
user = nagios
group = nagios
server = /usr/sbin/nrpe
server_args = -c /etc/nagios/nrpe.cfg --inetd
log_on_failure += USERID
disable = no
only_from = 127.0.0.1, 192.168.50.96
}
avlmp
ASKER
I seem to have made a mistake pasting that file...
Correct version is as follows:
service nrpe
{
flags = REUSE
socket_type = stream
port = 5666
wait = no
user = nagios
group = nagios
server = /usr/local/nagios/bin/nrpe
server_args = -c /usr/local/nagios/etc/nrpe.cfg --inetd
log_on_failure += USERID
disable = no
only_from = 10.254.1.1
}
Sanga Collins
Ok cool, The error message you are getting usually means the plugin is not in the right place. When you say you ran the command from the terminal, was this on the nagios server or on the remote server to be monitored?
When faced with the same problem (seems to happen everytime i install NRPE) I usually start on the remote server and work my way backwards.
i) can command be executed on remote server command line and return correct results?
ii) can command be executed on nagios server and return correct results?
iii) if ii) = no can any command at all be called from nagios server?
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy
avlmp
ASKER
i) yes
ii) yes
iii) I can perform a ping command successfully and it is displayed in the web interface, just not things related to check_nrpe
Sanga Collins
OK, I'm assuming you are running the commands as root account. If so, what is the result if you run the command as the nagios user on the remote server.
# su nagios
# /usr/local/nagios/libexec/check_load -w 15,10,5 -c 30,25,20
avlmp
ASKER
Result seems good:
OK - load average: 0.30, 0.09, 0.03|load1=0.300;15.000;30.000;0; load5=0.090;10.000;25.000;0; load15=0.030;5.000;20.000;0
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
# default: on
# description: NRPE (Nagios Remote Plugin Executor)
service nrpe
{
flags = REUSE
socket_type = stream
port = 5666
wait = no
user = nagios
group = nagios
server = /usr/sbin/nrpe
server_args = -c /etc/nagios/nrpe.cfg --inetd
log_on_failure += USERID
disable = no
only_from = 127.0.0.1, 192.168.50.96
}