Page 2 of 2

Re: Remote disk check not working

Posted: Wed Apr 27, 2016 4:54 pm
by ssax
Me personally, I would define it like this:

Code: Select all

define command {
       command_name                             check_nrpe
       command_line                             $USER1$/check_nrpe -H $HOSTADDRESS$ -t 30 -c $ARG1$ $ARG2$
}
Then each service would be defined like this:

Code: Select all

check_command                   check_nrpe!check_disk!-a '-w 20% -c 10% -p /'

check_command                   check_nrpe!check_cpu_stats!-a '-w 85 -c 95'

check_command                   check_nrpe!check_load!-a '-w 15,10,5 -c 30,20,10'
And just define the nrpe.cfg commands like so:

Code: Select all

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

command[check_cpu_stats]=/usr/local/nagios/libexec/check_cpu_stats.sh $ARG1$

command[check_load]=/usr/local/nagios/libexec/check_load $ARG1$

Which you may already have defined in /usr/local/nagios/etc/nrpe/common.cfg on your remote machine.

Re: Remote disk check not working

Posted: Wed Apr 27, 2016 5:07 pm
by jnojr
rkennedy wrote:Nice! Did that get it working for you on your system? Just trying to figure out if we can mark this as resolved.
On one system. On another, with the same service definition, I get:

DISK CRITICAL - 20% is not accessible: No such file or directory

check_nrpe via the command line both on server and client work. Both systems use the same check_nrpe_disk command, and both have the same check_command, so I'm really scratching my head here. I have to assume I changed something while stumbling around with the first host and forgot it :-/

Re: Remote disk check not working

Posted: Wed Apr 27, 2016 5:23 pm
by Box293
Please post your nrpe config from the machine that is not working.

Re: Remote disk check not working

Posted: Wed Apr 27, 2016 5:26 pm
by jnojr
Box293 wrote:Please post your nrpe config from the machine that is not working.
GAH I was using the default line for check_disk...

Got it now!

Re: Remote disk check not working

Posted: Wed Apr 27, 2016 6:03 pm
by Box293
Too easy. Let us know if there is anything else we can help with in relation to this issue.