Solved

Issues with Nagios NRPE monitoring (Return code of 127 is out of bounds - plugin may be missing)

Posted on 2012-12-27
11
4,280 Views
Last Modified: 2012-12-27
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
/usr/local/nagios/libexec/check_nrpe -H 10.254.1.2 -c check_load

Open in new window

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%
	}

Open in new window


commands.cfg
define command{
	command_name	check_nrpe
	command_line	USER1$/check_nrpe -H $HOSTADDRESS$ -c $ARG1$
	}

Open in new window


remote host side

/etc/xinetd.d/nrpe
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
}

Open in new window


nrpe.cfg
log_facility=daemon

pid_file=/var/run/nrpe.pid

server_port=5666

nrpe_user=nagios

nrpe_group=nagios

allowed_hosts=127.0.0.1,10.254.1.1

dont_blame_nrpe=0

debug=0

command_timeout=60

connection_timeout=300

command[check_users]=/usr/local/nagios/libexec/check_users -w 5 -c 10
command[check_load]=/usr/local/nagios/libexec/check_load -w 15,10,5 -c 30,25,20
command[check_hda1]=/usr/local/nagios/libexec/check_disk -w 20% -c 10% -p /dev/hda1
command[check_zombie_procs]=/usr/local/nagios/libexec/check_procs -w 5 -c 10 -s Z
command[check_total_procs]=/usr/local/nagios/libexec/check_procs -w 150 -c 200 

Open in new window

0
Comment
Question by:avlmp
  • 6
  • 5
11 Comments
 
LVL 18

Expert Comment

by:Sanga Collins
ID: 38724505
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
}
0
 

Author Comment

by:avlmp
ID: 38724538
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
}
0
 
LVL 18

Expert Comment

by:Sanga Collins
ID: 38725076
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?
0
 

Author Comment

by:avlmp
ID: 38725096
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
0
 
LVL 18

Expert Comment

by:Sanga Collins
ID: 38725230
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
0
NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

 

Author Comment

by:avlmp
ID: 38725250
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
0
 
LVL 18

Expert Comment

by:Sanga Collins
ID: 38725309
ok wow!

Next thing I look at is the nrpe.cfg in /etc/nagios ;

In mine, line 11 only the ip address of my nagios server as follows

allowed_hosts=192.168.50.96

instead of ...

allowed_hosts=127.0.0.1,192.168.50.96
0
 

Author Comment

by:avlmp
ID: 38725359
Doesn't seem to be changing anything, even after restarting nagios and xinetd services in their respective hosts.
0
 
LVL 18

Accepted Solution

by:
Sanga Collins earned 500 total points
ID: 38725631
I loaded all your config files into my nagios server and this is what I found :)

commands.cfg

define command{
      command_name      check_nrpe
      command_line      USER1$/check_nrpe -H $HOSTADDRESS$ -c $ARG1$
}

I think that should say $USER1$

this variable = path to nagios executables if it is incorrect then it would explain that nagios cannot find the plugin check_nrpe. It would also explain why everything tests correctly from the command line

Hope that helps :)
1
 

Author Comment

by:avlmp
ID: 38725684
God bless you, it works now!
0
 
LVL 18

Expert Comment

by:Sanga Collins
ID: 38725694
Fantastic! It's always the little things that get me too!
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Help with PCoIP Technology 9 87
Delegate IT support account to manage AD accounts and Groups in AD ? 3 54
Monitoring Exchange 2013 8 107
difference between ITSM and ITIL 2 40
Communication between departments might not happen in two different languages, but they do exist in two different worlds. With different targets and performance goals the same phrase often means something completely different to each party. Learn ho…
Online collaboration can help businesses be more efficient, help employees grow their skills and foster a team environment.
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
In this video I am going to show you how to back up and restore Office 365 mailboxes using CodeTwo Backup for Office 365. Learn more about the tool used in this video here: http://www.codetwo.com/backup-for-office-365/ (http://www.codetwo.com/ba…

895 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now