3.4.1 issues with NRPE config

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
bsfez
Posts: 23
Joined: Tue May 08, 2012 8:41 am

3.4.1 issues with NRPE config

Post by bsfez »

I'm running Nagios 3.4.1 on a monitoring server and i installed nrpe server on a remote machine.

I have a working server with 3.2.0 with the following command:

Code: Select all

define service{
        use                            generic-service
        host_name                 remoteserverip
        service_description    Current Load
        check_command        check_nrpe_1arg!check_load
}
I have understood it should work the same with 3.4.1.
But when i do : "/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg" i got an error;
Checking services...
Error: Service check command 'check_nrpe_1arg' specified in service 'Current Load' for host 'remoteserverip' not defined anywhere!
So I tried to do it the other way...

On my monitoring server i wrote:

Code: Select all

define service{
        use                            generic-service
        host_name                 remoteserverip
        service_description    Current Load
        check_command        check_nrpe!check_load
}
On my remote server i edit nrpe.cfg.
I set :
command[check_load]=/usr/lib/nagios/plugins/check_load -w 15,10,5 -c 30,25,20
(the following is commented : #command[check_load]=/usr/lib/nagios/plugins/check_load -w $ARG1$ -c $ARG2$)

Checking with ssh is ok : /usr/lib/nagios/plugins# ./check_nrpe -H remoteip -c check_load
OK - load average: 1.16, 2.42, 2.32|load1=1.160;15.000;30.000;0; load5=2.420;10.000;25.000;0; load15=2.320;5.000;20.000;0;

BUT Nagios dashboard on the monitoring is not. It says : "(No output returned from plugin)"
Nagios log on the monitoring server says : "Service Unknown[05-15-2012 13:31:50] SERVICE ALERT: remoteserverip;Current Load;UNKNOWN;SOFT;1;(No output returned from plugin)"
Syslog on remote server says :
May 15 14:55:33 mx nrpe[2225]: Starting up daemon
May 15 14:55:33 mx nrpe[2225]: Listening for connections on port 5666
May 15 14:55:33 mx nrpe[2225]: Allowing connections from: monitoringip

Humfff :(
Any help will be appreciated.

Bernard
puspharaj
Posts: 14
Joined: Tue May 15, 2012 2:17 am

Re: 3.4.1 issues with NRPE config

Post by puspharaj »

Try this first on your nagios server
/usr/local/nagios/libexec/check_nrpe -H remote_ip
this should return the nrpe version no

You dont need to specify the check_nrpe!

Just simply try with
check_command check_load
regards
Raj
bsfez
Posts: 23
Joined: Tue May 08, 2012 8:41 am

Re: 3.4.1 issues with NRPE config

Post by bsfez »

Hi Raj,
puspharaj wrote:Try this first on your nagios server
/usr/local/nagios/libexec/check_nrpe -H remote_ip
this should return the nrpe version no
The answer is: NRPE v2.12

If i set a you suggest

Code: Select all

define service{
        use                             generic-service         ; Name of service template to use
        host_name                       remote_ip
        service_description             Current Load
        check_command                   check_load
        }
On /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg i have:
Checking services...
Error: Service check command 'check_load' specified in service 'Current Load' for host 'remote_ip' not defined anywhere!

Tks for the help
Bernard
puspharaj
Posts: 14
Joined: Tue May 15, 2012 2:17 am

Re: 3.4.1 issues with NRPE config

Post by puspharaj »

Hey Bernard,

Did you have the check_load script file on the remote host ? this must be on /nagios/libexec/

Did you check the check_load on your /nagios/etc/object/commands.cfg ?

thanks
Raj
Last edited by puspharaj on Tue May 15, 2012 9:37 am, edited 1 time in total.
mguthrie
Posts: 4380
Joined: Mon Jun 14, 2010 10:21 am

Re: 3.4.1 issues with NRPE config

Post by mguthrie »

Did you by chance install a new nagios.cfg when you recompiled? The new would necessarily see all of your object definitions. Can you verify that the file with that command definition is included in nagios.cfg?
bsfez
Posts: 23
Joined: Tue May 08, 2012 8:41 am

Re: 3.4.1 issues with NRPE config

Post by bsfez »

puspharaj wrote:Hey Bernard,

Did you have the check_load script file on the remote host ? this must be on /nagios/libexec/
On my remote server in /usr/local/nagios/libexec i have only check_nrpe
Should more i understand ?
What ?
puspharaj wrote:Did you check the check_load on your /nagios/etc/object/commands.cfg ?
On my remote i don't have a command.cfg
On my monitoring local machine i have and check_load is in place.

However in my remote, /etc/nagios/nrpe.cfg, i have command[check_load]=/usr/lib/nagios/plugins/check_load -w 15,10,5 -c 30,25,20

>>?
bsfez
Posts: 23
Joined: Tue May 08, 2012 8:41 am

Re: 3.4.1 issues with NRPE config

Post by bsfez »

mguthrie wrote:Did you by chance install a new nagios.cfg when you recompiled? The new would necessarily see all of your object definitions. Can you verify that the file with that command definition is included in nagios.cfg?
MMmm my nagios.cfg (on my monitoring machine) says :
# NAGIOS.CFG - Sample Main Config File for Nagios 3.4.0

cfg_file=/usr/local/nagios/etc/objects/commands.cfg

command.cfg is 245 lines
and i can see there

Code: Select all

# 'check_nrpe' command definition
define command{
command_name check_nrpe
command_line /usr/lib/nagios/plugins/check_nrpe -H $HOSTADDRESS$ -c $ARG1$ -a $ARG2$
}
BUT nothing about "check_load"
mguthrie
Posts: 4380
Joined: Mon Jun 14, 2010 10:21 am

Re: 3.4.1 issues with NRPE config

Post by mguthrie »

The service definition is looking for a command named:
check_nrpe_1arg
If that command isn't defined anywhere (and nagios says it isn't), you'll need to create a new command definition for it.
bsfez
Posts: 23
Joined: Tue May 08, 2012 8:41 am

Re: 3.4.1 issues with NRPE config

Post by bsfez »

mguthrie wrote:The service definition is looking for a command named:
check_nrpe_1arg
If that command isn't defined anywhere (and nagios says it isn't), you'll need to create a new command definition for it.
?
I though "check_nrpe_1arg" was the way to write a command that talk to a remote server from Nagios as it was set in several tutorial i have read.
Beside on my nagios 3.2.0 this work just fine (no warning and the data seams to be correct):

Code: Select all

define service{
        use                     generic-service
        host_name               remoterserverip
        service_description     Current Load
        check_command           check_nrpe_1arg!check_load
}
mguthrie
Posts: 4380
Joined: Mon Jun 14, 2010 10:21 am

Re: 3.4.1 issues with NRPE config

Post by mguthrie »

In order for that service to work, you need this as a command definition:

Code: Select all

define command {
   command_name      check_nrpe_1arg
   command_line         $USER1$/check_nrpe $ARG1$

}
Locked