Page 1 of 1

check_nrpe passing wrong arguments?

Posted: Mon Jan 20, 2014 8:21 pm
by Wnt2bsleepin
Hello,

I have a service check for my machine that checks the disk usage. However, in the log file the arguments seem to be messed up.

Log:

Code: Select all

Running command: /usr/local/nagios/libexec/check_disk -w 20 10 /home -c  -p

Here is my local config file for it.

Code: Select all

check_nrpe!check_disk!20!10!/home


and here is the local NRPE command definition

Code: Select all

command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c $ARG1$ -a "$ARG2$ $ARG3$ $ARG4$"

Here is the remote command configuration

Code: Select all

command[check_disk]=/usr/local/nagios/libexec/check_disk -w $ARG1$ -c $ARG2$ -p $ARG3$

Am I missing something?

Re: check_nrpe passing wrong arguments?

Posted: Tue Jan 21, 2014 2:27 pm
by lmiltchev
I believe you need to have the "check_nrpe" command defined as such:

Code: Select all

$USER1$/check_nrpe -H $HOSTADDRESS$ -t 60 -c $ARG1$ $ARG2$
your check on the remote box:

Code: Select all

command[check_disk]=/usr/local/nagios/libexec/check_disk $ARG1$
your check on the nagios box:

Code: Select all

check_nrpe!check_disk!-a '-w 20% -c 10% -p /home'
Test it from the command line:

Code: Select all

./check_nrpe -H <client ip> -c check_disk -a '-w 20% -c 10% -p /home'

Re: check_nrpe passing wrong arguments?

Posted: Fri Jan 24, 2014 10:47 pm
by Wnt2bsleepin
That did it. Thank you very much.

Re: check_nrpe passing wrong arguments?

Posted: Sun Jan 26, 2014 10:06 pm
by tmcdonald
Nice to see a quick fix. I'll be locking this up now. If you have any other issues please feel free to open up another thread.