Page 1 of 1

NRPE: Command 'check_LV01_RootDirectory' not defined

Posted: Wed Sep 02, 2015 1:54 am
by wangyu
The Picture 1 show the command not defined.
The IP of nagios server is 10.134.40.139
The IP of nagios Client is 10.202.16.77

The Picture 2 show the nagios client disk information.

The Picture 3 show the nrpe.cfg in nagios server.
In picture 3 I add two lines in the nrpe.cfg , it's :
command[check_LV01_RootDirectory]=/usr/local/nagios/libexec/check_disk -w 20% -c 10% -p /dev/mapper/vg-LV01
command[check_LV00_DataDirectory]=/usr/local/nagios/libexec/check_disk -w 20% -c 10% -p /dev/mapper/vg-LV00

The Picture 4 show the nrpe.cfg in nagios client.
In picture 4 I add two lines in the nrpe.cfg , it's :
command[check_LV01_RootDirectory]=/usr/local/nagios/libexec/check_disk -w 20% -c 10% -p /dev/mapper/vg-LV01
command[check_LV00_DataDirectory]=/usr/local/nagios/libexec/check_disk -w 20% -c 10% -p /dev/mapper/vg-LV00

I Cannot add another attachment, 3 is the maximum.
The picture 4 is same as the picture 3.

When I finish complete this configuration , The Picture 1 show the command not defined.
So I want to know where configuration is wrong ?
Theversion of nagios is 3.5.0

sometimes I can define a command in commands.cfg
sometimes I can define a command in nrpe.cfg
I want to know the difference between commands.cfg and nrpe.cfg ?

Re: NRPE: Command 'check_LV01_RootDirectory' not defined

Posted: Wed Sep 02, 2015 2:08 am
by Box293
NRPE is for executing checks on remote servers.
wangyu wrote:The Picture 3 show the nrpe.cfg in nagios server.
In picture 3 I add two lines in the nrpe.cfg , it's :
command[check_LV01_RootDirectory]=/usr/local/nagios/libexec/check_disk -w 20% -c 10% -p /dev/mapper/vg-LV01
command[check_LV00_DataDirectory]=/usr/local/nagios/libexec/check_disk -w 20% -c 10% -p /dev/mapper/vg-LV00
You don't need to define this on your Nagios server.
wangyu wrote:The Picture 4 show the nrpe.cfg in nagios client.
In picture 4 I add two lines in the nrpe.cfg , it's :
command[check_LV01_RootDirectory]=/usr/local/nagios/libexec/check_disk -w 20% -c 10% -p /dev/mapper/vg-LV01
command[check_LV00_DataDirectory]=/usr/local/nagios/libexec/check_disk -w 20% -c 10% -p /dev/mapper/vg-LV00
So nrpe.cfg on the client defines the name of the check. With what you've configured you should be able to execute the following from your Nagios server:

Code: Select all

/usr/local/nagios/libexec/check_nrpe -H 10.202.16.77 -c check_LV01_RootDirectory
/usr/local/nagios/libexec/check_nrpe -H 10.202.16.77 -c check_LV00_DataDirectory
If this doesn't work, restart xinetd on the client machine:

Code: Select all

service xinetd restart
This is required whenever you change the nrpe.cfg

wangyu wrote:sometimes I can define a command in commands.cfg
sometimes I can define a command in nrpe.cfg
I want to know the difference between commands.cfg and nrpe.cfg ?
/usr/local/nagios/etc/nrpe.cfg is the main configuration file on the NRPE client.

commands.cfg on the Nagios server is where you define your command to use in services.
Services use commands to create checks. The commands have variables like $ARG1$ and $HOSTADDRESS$ which allow you to be dynamic in your configs.

Re: NRPE: Command 'check_LV01_RootDirectory' not defined

Posted: Sat Sep 05, 2015 10:21 pm
by wangyu
According to the method you tell me .
The picture 11 show the nagios client config of the nrpe.cfg
The picture 12 show the nagios server config of the nrpe.cfg

Then I restart the service of xinted on nagios client
[root@swhdtplmam01 /]# service xinetd restart
Stopping xinetd: [ OK ]
Starting xinetd: [ OK ]

Then I do this action on nagios server
But it continue report error:
[root@VSLHAGILEAP01 plugin]# /usr/local/nagios/libexec/check_nrpe -H 10.202.16.77 -c check_LV01_RootDirectory
NRPE: Command 'check_LV01_RootDirectory' not defined
[root@VSLHAGILEAP01 plugin]# /usr/local/nagios/libexec/check_nrpe -H 10.202.16.77 -c check_LV00_DataDirectory
NRPE: Command 'check_LV00_DataDirectory' not defined

What's the wrong about this problem ?

Re: NRPE: Command 'check_LV01_RootDirectory' not defined

Posted: Sun Sep 06, 2015 8:24 pm
by Box293
Can you please run these commands on the NRPE Client and show us the output:

Code: Select all

ps -C xinetd
ps -C nrpe

Re: NRPE: Command 'check_LV01_RootDirectory' not defined

Posted: Tue Sep 08, 2015 1:18 am
by wangyu
The picture 41.png show the result of the nagios client.

Re: NRPE: Command 'check_LV01_RootDirectory' not defined

Posted: Tue Sep 08, 2015 1:33 am
by Box293
It looks like you have both xinetd and nrpe running.

Try:

Code: Select all

kill 15985
kill 12850
service xinetd start
Does that fix your problem?

Re: NRPE: Command 'check_LV01_RootDirectory' not defined

Posted: Tue Sep 08, 2015 7:38 pm
by wangyu
When I stop the nrpe service ,the picture show the result ,other monitor is down.

Re: NRPE: Command 'check_LV01_RootDirectory' not defined

Posted: Tue Sep 08, 2015 7:54 pm
by Box293
So instead of starting xinetd, does starting the nrpe service work?

Re: NRPE: Command 'check_LV01_RootDirectory' not defined

Posted: Wed Sep 09, 2015 2:17 am
by wangyu
It's OK now,thanks very much for box 293.
Please see the picture 57

Re: NRPE: Command 'check_LV01_RootDirectory' not defined

Posted: Wed Sep 09, 2015 1:56 pm
by hsmith
wangyu wrote:It's OK now,thanks very much for box 293.
Please see the picture 57

Thanks for letting us know!

I'm going to go ahead and mark this one as resolved and lock it up.