Page 1 of 1

New plugin/check with NRPE - no output

Posted: Thu Sep 10, 2015 6:06 pm
by rickb
I am having trouble getting the check_eximailqueue working with NRPE. I have gone through the page for the plugin and at this point I have gotten to the point where I am getting "CHECK_NRPE: No output returned from daemon." when running ./check_nrpe -H MYREMOTEHOSTNAME.COM -c check_eximailqueue -a '-w 1 -c 2' (running for check_cpu, etc work fine)

If I run it on the remote server directly it does come back with correct output with the command ./check_eximailqueue '-w 1 -c 2'

I have checked and changed the EXIM path and added the nagios ALL=NOPASSWD:/usr/local/exim/bin/exim AND nagios ALL=NOPASSWD:/usr/sbin/exim to the sudo users along with the command[check_eximailqueue]=/usr/local/nagios/libexec/check_eximailqueue -w $ARG1$ -c $ARG2$ to the /usr/local/nagios/etc/nrpe.cfg on the remote server.

RHEL 6.5 with cpanel

Anybody have any other suggestions to look at?

Thanks!

Re: New plugin/check with NRPE - no output

Posted: Thu Sep 10, 2015 7:31 pm
by Box293
rickb wrote:I am having trouble getting the check_eximailqueue working with NRPE. I have gone through the page for the plugin and at this point I have gotten to the point where I am getting "CHECK_NRPE: No output returned from daemon." when running ./check_nrpe -H MYREMOTEHOSTNAME.COM -c check_eximailqueue -a '-w 1 -c 2' (running for check_cpu, etc work fine)
Your problem is this:

Code: Select all

-a '-w 1 -c 2'
The NRPE client will receive this as $ARG1$ and try to execute the following:

Code: Select all

/usr/local/nagios/libexec/check_eximailqueue -w -w 1 -c 2 -c 
This is because you use single quotes around '-w 1 -c 2', it sends it as one argument. Also, you're sending the -w and -c flags when they are already defined at the far end, you only need to send the values.

With this defined:

Code: Select all

command[check_eximailqueue]=/usr/local/nagios/libexec/check_eximailqueue -w $ARG1$ -c $ARG2$
You should be able to execute:

Code: Select all

./check_nrpe -H MYREMOTEHOSTNAME.COM -c check_eximailqueue -a 1 2


Does this get you on the right path?

Re: New plugin/check with NRPE - no output

Posted: Sat Sep 12, 2015 12:06 am
by rickb
I understand what you where saying with the examples you gave back to me but every combination I did in the service configuration did not work correctly.

I ended up placing this in the /usr/local/nagios/etc/nrpe/common.cfg on the host

Code: Select all

command[check_eximailqueue]=/usr/local/nagios/libexec/check_eximailqueue.pl $ARG1$ $ARG2$
and using the other nrpe service checks configs that the wizard produced as a guide when we configured the host originally I used this.

Code: Select all

$ARG1$ check_eximailqueue
$ARG2$ -a '-w 20 -c 30'
Not really seeing why in the common it would work but not the nrpe.cfg?

Thanks for the help!

Re: New plugin/check with NRPE - no output

Posted: Mon Sep 14, 2015 10:24 am
by tmcdonald
That's a very good question. Did you maybe have it defined in both locations? That could cause it to overwrite, especially if one location had the correct definition and the other did not. Are you 100% sure it was defined properly regardless of where you placed it?

Re: New plugin/check with NRPE - no output

Posted: Mon Sep 14, 2015 10:30 am
by lmiltchev
Not really seeing why in the common it would work but not the nrpe.cfg?
You can define commands in either config (common.cfg or nrpe.cfg) - both should work. You can't have the same command defined in both files, though. If you have "duplicates" - comment out one of the commands.