Page 1 of 1

NRPE command "X" not defined!

Posted: Tue Nov 30, 2010 12:53 pm
by jovin
So, I've been trying to run figure out how to setup nagios to check a remote vm CentOS 5.5 linux box. Now, my knowledge of nagios is very limited - very new to nagios to be exact.

But I ran into this problem for some reason I can't figure out. It has to do with running a check_disk on a remote system.

Here's what I have on nrpe.cfg for checking the remote linux

Code: Select all

command[check_load]=/usr/local/nagios/libexec/check_load -w 15,10,5 -c 30,25,20
command[check_sda1]=/usr/local/nagios/libexec/check_disk -w 20% -c 10% -p /dev/sda1
command[check_total_procs]=/usr/local/nagios/libexec/check_procs -w 150 -c 200
And, here's what I have on my services.cfg

Code: Select all

define service{
            use                                                generic-service
            host_name                                     vmlinux0
            service_description                         CPU Load
            check_command                              check_nrpe!check_load
            }

define service{
            use                                                generic-service
            host_name                                     vmlinux0
            service_description                         Free Disk Space
            check_command                              check_nrpe!check_disk
            }

define service{
            use                                                generic-service
            host_name                                     vmlinux0
            service_description                         Total Processes
            check_command                              check_nrpe!check_total_procs
            }
When I run nagios, the other two seems to be working but the check_disk command gives me an error message: "NRPE: Command 'check_sda1' not defined". I checked to make sure that there is a drive called /dev/sda1 by running the command 'df' on the remote vmlinux.

I've also tried to manually run nrpe command:

Code: Select all

/usr/local/nagios/libexec/check_nrpe -H xxx.xxx.xxx.xxx -c check_sda1
Of course I get the same error - "NRPE: Command 'check_sda1' not defined". I've also tried running the other 2 nrpe commands - and they work.

The other two NRPE command works. It gives me the total process and CPU load of the remote linux. I have restarted the services on both monitoring and remote machine and have even restarted both system - same result. I don't get why 2 of the 3 nrpe command works

Your help is greatly appreciated. Thanks.

Re: NRPE command "X" not defined!

Posted: Tue Nov 30, 2010 5:47 pm
by jovin
Closed - figured it out. Thanks for looking.