Page 1 of 1

Command not defined

Posted: Mon Mar 24, 2014 10:41 am
by spongedoc
Hi!

I read this forum 2 days, but don't help my problem.
I installed a nagios 4, and a host with NRPE 2.14. I configured the nrpe.cfg file, and some hardcoded command works fine, but the check_http is add a NRPE: Command 'check_http' not defined error.
I restarted the xinetd, the nrpe, but dont changed.

This is my hardcoded command lines:

Code: Select all

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_http]=/usr/local/nagios/libexec/check_http -H localhost
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
The check_user, check_load, check_total_procs commands working fine. The check_http drop the error, but the

Code: Select all

./check_http -H localhost
command under the libexec folder run without error.

I copy the hosts.cfg:

Code: Select all

## Default Linux Host Template ##
define host{
name                            linux-box               ; Name of this template
use                             generic-host            ; Inherit default values
check_period                    24x7
check_interval                  5
retry_interval                  1
max_check_attempts              10
check_command                   check-host-alive
notification_period             24x7
notification_interval           30
notification_options            d,r
register                        0                       ; DONT REGISTER THIS - ITS A TEMPLATE
}

## Default
define host{
use                             linux-box               ; Inherit default value$
host_name                       X                    ; The name we're giving$
alias                           CentOS 6                ; A longer name for the$
address                         x.x.x.x                ; IP address of Remo$
contacts                        Peter
}
My brain is out...
What is the problem?

Thank you!

Re: Command not defined

Posted: Mon Mar 24, 2014 12:03 pm
by slansing
Well, check_http is not normally checked via nrpe as it has the capability to be pointed directly at an address rather than having to be ran against a local system via an agent such as NRPE. From the nagios server, you should be able to check your web addresses by running the following command:

Code: Select all

/usr/local/nagios/libexec/check_http -H <addr.of.object/site>

Re: Command not defined

Posted: Tue Mar 25, 2014 10:59 am
by spongedoc
Hi slansing,

I make the suggested changes, and the http working fine in the server.

I try to make a hdd report like this:

Code: Select all

NRP.CFG /remote server/
command[check_disk_root]=/usr/local/nagios/libexec/check_disk -w 20% -c 10% -p /

SERVICES.CFG /nagios server/
define service{
        use                     generic-service
        host_name               XXX
        service_description     Root Partition
        check_command           check_nrpe!check_disk_root
        }
Same error: NRPE: Command 'check_disk_root' not defined

Three another command works fine.
I reseted the xinetd, nrpe, nagios.

Thank you

Re: Command not defined

Posted: Tue Mar 25, 2014 4:10 pm
by abrist
Does the command "check_disk_root" exist in your remote host's nrpe.cfg?
If so, did you restart nrpe/xinetd after making the changes?

Re: Command not defined

Posted: Wed Mar 26, 2014 4:55 am
by spongedoc
Yes, this is my command list. I write whixh working:

Code: Select all

# The following examples use hardcoded command arguments...

command[check_users]=/usr/local/nagios/libexec/check_users -w 5 -c 10                              #WORKING
command[check_load]=/usr/local/nagios/libexec/check_load -w 15,10,5 -c 30,25,20              #WORKING
command[check_http]=/usr/local/nagios/libexec/check_http -H localhost                              #NOT USED
command[check_zombie_procs]=/usr/local/nagios/libexec/check_procs -w 5 -c 10 -s Z           #NOT USED
command[check_total_procs]=/usr/local/nagios/libexec/check_procs -w 150 -c 200                #WORKING
command[check_disk_root]=/usr/local/nagios/libexec/check_disk -w 20% -c 10% -p /             # NOT WORKING NRPE: Command 'check_disk_root' not defined
I restarted the remote host xinetd, nrpe.
And restarted the nagios server.

Thank you

Re: Command not defined

Posted: Wed Mar 26, 2014 10:33 am
by spongedoc
Another reason we need to restart the server.

After full restart, the command run normally.

Thank you