NRPE: Command 'check_LV01_RootDirectory' 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
wangyu
Posts: 41
Joined: Tue Aug 25, 2015 2:41 am

NRPE: Command 'check_LV01_RootDirectory' not defined

Post 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 ?
Attachments
3.png
2.png
2.png (5.95 KiB) Viewed 2873 times
1.png
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: NRPE: Command 'check_LV01_RootDirectory' not defined

Post 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.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
wangyu
Posts: 41
Joined: Tue Aug 25, 2015 2:41 am

Re: NRPE: Command 'check_LV01_RootDirectory' not defined

Post 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 ?
Attachments
12.png
12.png (10.67 KiB) Viewed 2858 times
11.png
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: NRPE: Command 'check_LV01_RootDirectory' not defined

Post 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
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
wangyu
Posts: 41
Joined: Tue Aug 25, 2015 2:41 am

Re: NRPE: Command 'check_LV01_RootDirectory' not defined

Post by wangyu »

The picture 41.png show the result of the nagios client.
Attachments
41.png
41.png (3.59 KiB) Viewed 2840 times
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: NRPE: Command 'check_LV01_RootDirectory' not defined

Post 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?
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
wangyu
Posts: 41
Joined: Tue Aug 25, 2015 2:41 am

Re: NRPE: Command 'check_LV01_RootDirectory' not defined

Post by wangyu »

When I stop the nrpe service ,the picture show the result ,other monitor is down.
Attachments
49.png
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: NRPE: Command 'check_LV01_RootDirectory' not defined

Post by Box293 »

So instead of starting xinetd, does starting the nrpe service work?
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
wangyu
Posts: 41
Joined: Tue Aug 25, 2015 2:41 am

Re: NRPE: Command 'check_LV01_RootDirectory' not defined

Post by wangyu »

It's OK now,thanks very much for box 293.
Please see the picture 57
Attachments
57.png
User avatar
hsmith
Agent Smith
Posts: 3539
Joined: Thu Jul 30, 2015 11:09 am
Location: 127.0.0.1
Contact:

Re: NRPE: Command 'check_LV01_RootDirectory' not defined

Post 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.
Former Nagios Employee.
me.
Locked