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
NRPE:command Check_disk not defined
Re: NRPE:command Check_disk not defined
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.
Show us the actual command that you are running from the command line on the Nagios XI server along with the output of it.
Be sure to check out our Knowledgebase for helpful articles and solutions!
-
Beena_Jogin
- Posts: 54
- Joined: Fri Jan 22, 2016 4:58 am
Re: NRPE:command Check_disk not defined
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
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
The arguments are "hard-coded". Why are you trying to pass them again?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
Here's the two scenarios that you can use: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>'
1.
On the client:
Code: Select all
command[check_users]=/usr/local/nagios/libexec/check_users -w 5 -c 10Code: Select all
/usr/local/nagios/libexec/check_nrpe -H <client ip> -c check_usersOn the client:
Code: Select all
command[check_users]=/usr/local/nagios/libexec/check_users $ARG1$Code: Select all
/usr/local/nagios/libexec/check_nrpe -H <client ip> -c check_users -a '-w 5 -c 10'"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?NRPE:command Check_disk not defined
Be sure to check out our Knowledgebase for helpful articles and solutions!
-
Beena_Jogin
- Posts: 54
- Joined: Fri Jan 22, 2016 4:58 am
Re: NRPE:command Check_disk not defined
[[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
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
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:
and restart xinetd (or nrpe if it is running as a stand alone daemon)
Next, test your check from the XI:
Instead of passing 3 arguments, you could pass only one, for example:
On the remote box:
On XI:
You can change it to:#command[check_disk]=/usr/local/nagios/libexec/check_disk -w $ARG1$ -c $ARG2$ -p $ARG3$
Code: Select all
command[check_disk]=/usr/local/nagios/libexec/check_disk -w $ARG1$ -c $ARG2$ -p $ARG3$Code: Select all
service xinetd restartCode: Select all
/usr/local/nagios/libexec/check_nrpe -H <client ip> -c check_disk -a 20 10 /On the remote box:
Code: Select all
command[check_disk]=/usr/local/nagios/libexec/check_disk $ARG1$Code: Select all
/usr/local/nagios/libexec/check_nrpe -H <client ip> -c check_disk -a '-w 20 -c 10 -p /'Be sure to check out our Knowledgebase for helpful articles and solutions!