Command not defined

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.
Locked
spongedoc
Posts: 4
Joined: Wed Mar 19, 2014 5:35 am

Command not defined

Post 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!
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Command not defined

Post 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>
spongedoc
Posts: 4
Joined: Wed Mar 19, 2014 5:35 am

Re: Command not defined

Post 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
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Command not defined

Post 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?
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
spongedoc
Posts: 4
Joined: Wed Mar 19, 2014 5:35 am

Re: Command not defined

Post 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
spongedoc
Posts: 4
Joined: Wed Mar 19, 2014 5:35 am

Re: Command not defined

Post by spongedoc »

Another reason we need to restart the server.

After full restart, the command run normally.

Thank you
Locked