Page 1 of 1

NRPE:command Check_disk not defined

Posted: Thu Mar 17, 2016 11:10 am
by Beena_Jogin
Hi,

We are getting the below NRPE errors when we onboarded Linux host on Nagios XI. Please help

NRPE:command Check_disk not defined
NRPE:command Check_mem not defined
NRPE:command Check_cpu_stats not defined
NRPE:command Check_services not defined
NRPE:command Check_swap not defined

Beena

Re: NRPE:command Check_disk not defined

Posted: Thu Mar 17, 2016 12:20 pm
by lmiltchev
What is the OS/architecture of the client (remote machine)? Can you show us how these commands are defined on the client?

Show us the actual command that you are running from the command line on the Nagios XI server along with the output of it.

Re: NRPE:command Check_disk not defined

Posted: Fri Mar 18, 2016 10:38 am
by Beena_Jogin
Hi,

The OS/Architecture is as follows -

[email protected]:~# uname -a
Linux xx.xx.xx.xx 3.16.0-30-generic #40~14.04.1-Ubuntu SMP Thu Jan 15 17:43:14 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux

And NRPE config file details are as follows -

# The following examples use hardcoded command arguments...

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_hda1]=/usr/local/nagios/libexec/check_disk -w 20% -c 10% -p /dev/hda1
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 following examples allow user-supplied arguments and can
# only be used if the NRPE daemon was compiled with support for
# command arguments *AND* the dont_blame_nrpe directive in this
# config file is set to '1'. This poses a potential security risk, so
# make sure you read the SECURITY file before doing this.

#command[check_users]=/usr/local/nagios/libexec/check_users -w $ARG1$ -c $ARG2$
#command[check_load]=/usr/local/nagios/libexec/check_load -w $ARG1$ -c $ARG2$
#command[check_disk]=/usr/local/nagios/libexec/check_disk -w $ARG1$ -c $ARG2$ -p $ARG3$
#command[check_procs]=/usr/local/nagios/libexec/check_procs -w $ARG1$ -c $ARG2$ -s $ARG3$


And the commands used are as below -

check_nrpe -H <Hostaddress> -t 30 -c check_cpu_stats -a '-w 80 -c 90'
check_nrpe -H <Hostaddress> -t 30 -c check_mem -a '-w 20 -c 10'
check_nrpe -H <Hostaddress> -t 30 -c check_disk -a '-w 15% -c 10% -p/'
check_nrpe -H <Hostaddress> -t 30 -c check_swap -a '-w 20 -c 10'
check_nrpe -H <Hostaddress> -t 30 -c check_services -a '<service name>'

Beena

Re: NRPE:command Check_disk not defined

Posted: Fri Mar 18, 2016 10:59 am
by lmiltchev
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_hda1]=/usr/local/nagios/libexec/check_disk -w 20% -c 10% -p /dev/hda1
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 arguments are "hard-coded". Why are you trying to pass them again?
check_nrpe -H <Hostaddress> -t 30 -c check_cpu_stats -a '-w 80 -c 90'
check_nrpe -H <Hostaddress> -t 30 -c check_mem -a '-w 20 -c 10'
check_nrpe -H <Hostaddress> -t 30 -c check_disk -a '-w 15% -c 10% -p/'
check_nrpe -H <Hostaddress> -t 30 -c check_swap -a '-w 20 -c 10'
check_nrpe -H <Hostaddress> -t 30 -c check_services -a '<service name>'
Here's the two scenarios that you can use:
1.
On the client:

Code: Select all

command[check_users]=/usr/local/nagios/libexec/check_users -w 5 -c 10
Test from XI:

Code: Select all

/usr/local/nagios/libexec/check_nrpe -H <client ip> -c check_users
2.
On the client:

Code: Select all

command[check_users]=/usr/local/nagios/libexec/check_users $ARG1$
Test from XI:

Code: Select all

/usr/local/nagios/libexec/check_nrpe -H <client ip> -c check_users -a '-w 5 -c 10'
It is strange you are getting errors like this one:
NRPE:command Check_disk not defined
"Check_disk" is not the same as "check_disk"... Did you define your service (in XI) with "Check_disk" (capital "C") in the "check_command" directive?

Re: NRPE:command Check_disk not defined

Posted: Mon Mar 21, 2016 2:22 pm
by Beena_Jogin
[[email protected] libexec]# ./check_nrpe -H 10.xx.xx.xx.xx -c check_users
USERS OK - 0 users currently logged in |users=0;5;10;0

No there is nothing case sensitive, all are in lower letters

Do we need to define these commands in remote host anywhere?

Thanks,
Beena

Re: NRPE:command Check_disk not defined

Posted: Mon Mar 21, 2016 2:59 pm
by lmiltchev
Yes, the commands need to be defined on the remote box. From the commands that you showed us, I see that "check_disk" is defined in your nrpe.cfg file, but it is commented out:
#command[check_disk]=/usr/local/nagios/libexec/check_disk -w $ARG1$ -c $ARG2$ -p $ARG3$
You can change it to:

Code: Select all

command[check_disk]=/usr/local/nagios/libexec/check_disk -w $ARG1$ -c $ARG2$ -p $ARG3$
and restart xinetd (or nrpe if it is running as a stand alone daemon)

Code: Select all

service xinetd restart
Next, test your check from the XI:

Code: Select all

/usr/local/nagios/libexec/check_nrpe -H <client ip> -c check_disk -a 20 10 /
Instead of passing 3 arguments, you could pass only one, for example:

On the remote box:

Code: Select all

command[check_disk]=/usr/local/nagios/libexec/check_disk $ARG1$
On XI:

Code: Select all

/usr/local/nagios/libexec/check_nrpe -H <client ip> -c check_disk -a '-w 20 -c 10 -p /'