NRPE test ok but with args get Unknown argument -Help Please
-
danielbcjr
- Posts: 9
- Joined: Thu Feb 06, 2014 12:48 pm
NRPE test ok but with args get Unknown argument -Help Please
Hi guys,
I´m brand new about nrpe, I followed the docs about install Nagios Core and NRPE. In the nagios server, when i test the NRPE from the cliente i get:
[root@solitude ~]# /usr/local/nagios/libexec/check_nrpe -H 145.125.99.18
NRPE v2.15
But when I use commands and agrs I had that:
[root@solitude ~]# /usr/local/nagios/libexec/check_nrpe -H 145.125.99.18 -c check_disk 85% 90% /
Unknown argument
Usage:
check_disk -w limit -c limit [-W limit] [-K limit] {-p path | -x device}
[-C] [-E] [-e] [-f] [-g group ] [-k] [-l] [-M] [-m] [-R path ] [-r path ]
[-t timeout] [-u unit] [-v] [-X type] [-N type]
All the commands that I did with NRPE have the same problem.
Docs:
Solitude = Nagios Server
Winterhold = NRPE client
[root@solitude ~]# cat /usr/local/nagios/etc/servers/winterhold.cfg
define host{
name winterhold ; Name of this template
use generic-host
check_period 24x7
check_interval 1
retry_interval 1
max_check_attempts 10
check_command check-host-alive
notification_period 24x7
notification_interval 30
notification_options d,r
contact_groups admins
register 0 ; DONT REGISTER THIS - ITS A TEMPLATE
}
define host{
use linux-server ; Default values from a template
host_name winterhold ; The name we're giving to this server
alias Winterhold ; Name for the server
address 145.125.99.18 ; IP address of the server
}
define service{
use generic-service
host_name winterhold
service_description CPU CPU/Procs
check_command check_nrpe!check_procs!!40%!60%!--metric=CPU
}
define service{
use generic-service
host_name winterhold
service_description CPU Load
check_command check_nrpe!check_load!2.0,1.8,1,3!3.5,3.1,2.8
}
define service{
use generic-service
host_name winterhold
service_description Current Users
check_command check_nrpe!check_users!5!10
}
define service{
use generic-service
host_name winterhold
service_description / Free Space
check_command check_nrpe!check_disk! 20%! 10%! /
}
NRPE command in /usr/local/nagios/etc/objests/commands.cfg:
define command{
command_name check_nrpe
command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c $ARG1$
}
NRPE cliente (Winterhold):
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$
Hekp =/
I´m brand new about nrpe, I followed the docs about install Nagios Core and NRPE. In the nagios server, when i test the NRPE from the cliente i get:
[root@solitude ~]# /usr/local/nagios/libexec/check_nrpe -H 145.125.99.18
NRPE v2.15
But when I use commands and agrs I had that:
[root@solitude ~]# /usr/local/nagios/libexec/check_nrpe -H 145.125.99.18 -c check_disk 85% 90% /
Unknown argument
Usage:
check_disk -w limit -c limit [-W limit] [-K limit] {-p path | -x device}
[-C] [-E] [-e] [-f] [-g group ] [-k] [-l] [-M] [-m] [-R path ] [-r path ]
[-t timeout] [-u unit] [-v] [-X type] [-N type]
All the commands that I did with NRPE have the same problem.
Docs:
Solitude = Nagios Server
Winterhold = NRPE client
[root@solitude ~]# cat /usr/local/nagios/etc/servers/winterhold.cfg
define host{
name winterhold ; Name of this template
use generic-host
check_period 24x7
check_interval 1
retry_interval 1
max_check_attempts 10
check_command check-host-alive
notification_period 24x7
notification_interval 30
notification_options d,r
contact_groups admins
register 0 ; DONT REGISTER THIS - ITS A TEMPLATE
}
define host{
use linux-server ; Default values from a template
host_name winterhold ; The name we're giving to this server
alias Winterhold ; Name for the server
address 145.125.99.18 ; IP address of the server
}
define service{
use generic-service
host_name winterhold
service_description CPU CPU/Procs
check_command check_nrpe!check_procs!!40%!60%!--metric=CPU
}
define service{
use generic-service
host_name winterhold
service_description CPU Load
check_command check_nrpe!check_load!2.0,1.8,1,3!3.5,3.1,2.8
}
define service{
use generic-service
host_name winterhold
service_description Current Users
check_command check_nrpe!check_users!5!10
}
define service{
use generic-service
host_name winterhold
service_description / Free Space
check_command check_nrpe!check_disk! 20%! 10%! /
}
NRPE command in /usr/local/nagios/etc/objests/commands.cfg:
define command{
command_name check_nrpe
command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c $ARG1$
}
NRPE cliente (Winterhold):
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$
Hekp =/
-
slansing
- Posts: 7698
- Joined: Mon Apr 23, 2012 4:28 pm
- Location: Travelling through time and space...
Re: NRPE test ok but with args get Unknown argument -Help Pl
It is telling you that you have problems with your command's syntax. You are missing your warning and critical definitions. Try running this to start with:
Also, you should have spaces between your $ARGn$ values, and the flags you are passing in your nrpe.cfg, this:
Should be:
I would however, recommend changing it to:
Then use the following command from the nagios server:
Code: Select all
/usr/local/nagios/libexec/check_nrpe -H 145.125.99.18 -c check_diskCode: Select all
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
command[check_disk]=/usr/local/nagios/libexec/check_disk $ARG1$Code: Select all
/usr/local/nagios/libexec/check_nrpe -H 145.125.99.18 -c check_disk -a '-w 85% -c 90% -p /'-
danielbcjr
- Posts: 9
- Joined: Thu Feb 06, 2014 12:48 pm
Re: NRPE test ok but with args get Unknown argument -Help Pl
Thank you for aswering that ^^
That is what happens:
In the Nagios page I go this in service screen:
Current Status: UNKNOWN (for 0d 1h 47m 6s)
Status Information: check_disk: Could not parse arguments
Usage:
check_disk -w limit -c limit [-W limit] [-K limit] {-p path
Performance Data: -x device} [-C] [-E] [-e] [-f] [-g group ] [-k] [-l] [-M] [-m] [-R path ] [-r path ] [-t timeout] [-u unit] [-v] [-X type] [-N type]
That is what happens:
I made this, but I get this in the command line:slansing wrote:It is telling you that you have problems with your command's syntax. You are missing your warning and critical definitions. Try running this to start with:Also, you should have spaces between your $ARGn$ values, and the flags you are passing in your nrpe.cfg, this:Code: Select all
/usr/local/nagios/libexec/check_nrpe -H 145.125.99.18 -c check_diskShould be:Code: Select all
command[check_disk]=/usr/local/nagios/libexec/check_disk -w$ARG1$ -c$ARG2$ -p$ARG3$Fixed until now.Code: Select all
command[check_disk]=/usr/local/nagios/libexec/check_disk -w $ARG1$ -c $ARG2$ -p $ARG3$
I would however, recommend changing it to:
Then use the following command from the nagios server:Code: Select all
command[check_disk]=/usr/local/nagios/libexec/check_disk $ARG1$
Code: Select all
/usr/local/nagios/libexec/check_nrpe -H 145.125.99.18 -c check_disk -a '-w 85% -c 90% -p /'
Code: Select all
[root@solitude ~]# /usr/local/nagios/libexec/check_nrpe -H 145.125.99.18
NRPE v2.15
[root@solitude ~]# /usr/local/nagios/libexec/check_nrpe -H 145.125.99.18 -c check_disk -a '-w 85% -c 90% -p /'
CHECK_NRPE: Received 0 bytes from daemon. Check the remote server logs for error messages.Current Status: UNKNOWN (for 0d 1h 47m 6s)
Status Information: check_disk: Could not parse arguments
Usage:
check_disk -w limit -c limit [-W limit] [-K limit] {-p path
Performance Data: -x device} [-C] [-E] [-e] [-f] [-g group ] [-k] [-l] [-M] [-m] [-R path ] [-r path ] [-t timeout] [-u unit] [-v] [-X type] [-N type]
-
danielbcjr
- Posts: 9
- Joined: Thu Feb 06, 2014 12:48 pm
Re: NRPE test ok but with args get Unknown argument -Help Pl
Just to know, NRPE was configured with --enable-command-args and --enable-bash-command-substitution.
In nrpe.cfg of client:
dont_blame_nrpe=1
allow_bash_command_substitution=1
In nrpe.cfg of client:
dont_blame_nrpe=1
allow_bash_command_substitution=1
Re: NRPE test ok but with args get Unknown argument -Help Pl
Did you check the logs? Any errors?CHECK_NRPE: Received 0 bytes from daemon. Check the remote server logs for error messages.
Can you post the "check_disk" definition from the remote box?
Be sure to check out our Knowledgebase for helpful articles and solutions!
-
danielbcjr
- Posts: 9
- Joined: Thu Feb 06, 2014 12:48 pm
Re: NRPE test ok but with args get Unknown argument -Help Pl
No error =/lmiltchev wrote:Did you check the logs? Any errors?CHECK_NRPE: Received 0 bytes from daemon. Check the remote server logs for error messages.
Can you post the "check_disk" definition from the remote box?
Code: Select all
Feb 13 18:47:46 winterhold xinetd[8058]: EXIT: nrpe status=0 pid=8270 duration=0(sec)
Feb 13 18:48:09 winterhold xinetd[8058]: START: nrpe pid=8273 from=::ffff:189.125.66.7
Feb 13 18:48:09 winterhold nrpe[8273]: INFO: SSL/TLS initialized. All network traffic will be encrypted.
Feb 13 18:48:09 winterhold xinetd[8058]: EXIT: nrpe status=0 pid=8273 duration=0(sec)
Feb 13 18:48:11 winterhold xinetd[8058]: START: nrpe pid=8276 from=::ffff:189.125.66.7
Feb 13 18:48:11 winterhold nrpe[8276]: INFO: SSL/TLS initialized. All network traffic will be encrypted.
Feb 13 18:48:11 winterhold xinetd[8058]: EXIT: nrpe status=0 pid=8276 duration=0(sec)
Feb 13 18:48:17 winterhold xinetd[8058]: START: nrpe pid=8279 from=::ffff:189.125.66.7
Feb 13 18:48:17 winterhold nrpe[8279]: INFO: SSL/TLS initialized. All network traffic will be encrypted.
Feb 13 18:48:17 winterhold xinetd[8058]: EXIT: nrpe status=0 pid=8279 duration=0(sec)
This way:
Code: Select all
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$Code: Select all
command[check_disk]=/usr/local/nagios/libexec/check_disk $ARG1$Re: NRPE test ok but with args get Unknown argument -Help Pl
Use the command, provided by slansing:
Restart nrpe.
Note: This may vary, depending on your system...
Test the check by running the following command on the nagios server:
If this fails, try:
Code: Select all
command[check_disk]=/usr/local/nagios/libexec/check_disk $ARG1$Code: Select all
/etc/init.d/nagios-nrpe-server restartTest the check by running the following command on the nagios server:
Code: Select all
./check_nrpe -H <client ip> -c check_disk -a '-w 20% -c 10% -p /Code: Select all
./check_nrpe -H <client ip> -n -c check_disk -a '-w 20% -c 10% -p /Be sure to check out our Knowledgebase for helpful articles and solutions!
-
danielbcjr
- Posts: 9
- Joined: Thu Feb 06, 2014 12:48 pm
Re: NRPE test ok but with args get Unknown argument -Help Pl
Hi lmiltchev
Tahnk you for helping.
=/
Tahnk you for helping.
Reply:lmiltchev wrote:Use the command, provided by slansing:
DONECode: Select all
command[check_disk]=/usr/local/nagios/libexec/check_disk $ARG1$
Restart nrpe.
Mine is:Code: Select all
/etc/init.d/nagios-nrpe-server restartDONECode: Select all
/etc/init.d/xinetd restart
Note: This may vary, depending on your system...
Test the check by running the following command on the nagios server:
Reply:Code: Select all
./check_nrpe -H <client ip> -c check_disk -a '-w 20% -c 10% -p /Code: Select all
[root@solitude etc]# /usr/local/nagios/libexec/check_nrpe -H 189.125.66.9 -c check_disk -a '-w 20% -c 10% -p /' CHECK_NRPE: Received 0 bytes from daemon. Check the remote server logs for error messages.
If this fails, try:
Code: Select all
./check_nrpe -H <client ip> -n -c check_disk -a '-w 20% -c 10% -p /
Code: Select all
[root@solitude etc]# /usr/local/nagios/libexec/check_nrpe -H 189.125.66.9 -c -n check_disk -a '-w 20% -c 10% -p /'
CHECK_NRPE: Received 0 bytes from daemon. Check the remote server logs for error messages.=/
Re: NRPE test ok but with args get Unknown argument -Help Pl
I think lmiltchev might have missed an ending quote. Try this:lmiltchev wrote:
Test the check by running the following command on the nagios server:
If this fails, try:Code: Select all
./check_nrpe -H <client ip> -c check_disk -a '-w 20% -c 10% -p /
Code: Select all
./check_nrpe -H <client ip> -n -c check_disk -a '-w 20% -c 10% -p /
lmiltchev wrote:
Test the check by running the following command on the nagios server:
If this fails, try:Code: Select all
./check_nrpe -H <client ip> -c check_disk -a '-w 20% -c 10% -p /'
Code: Select all
./check_nrpe -H <client ip> -n -c check_disk -a '-w 20% -c 10% -p /'
Former Nagios employee
-
danielbcjr
- Posts: 9
- Joined: Thu Feb 06, 2014 12:48 pm
Re: NRPE test ok but with args get Unknown argument -Help Pl
That are the results:
Code: Select all
[root@solitude libexec]# ./check_nrpe -H 189.125.66.9 -c check_disk -a '-w 20% -c 10% -p /'
CHECK_NRPE: Received 0 bytes from daemon. Check the remote server logs for error messages.
[root@solitude libexec]# ./check_nrpe -H <client ip> -n -c check_disk -a '-w 20% -c 10% -p /'
-bash: client: No such file or directory