New plugin/check with NRPE - no output

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
rickb
Posts: 6
Joined: Sun Feb 22, 2015 11:55 am

New plugin/check with NRPE - no output

Post 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!
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: New plugin/check with NRPE - no output

Post 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?
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
rickb
Posts: 6
Joined: Sun Feb 22, 2015 11:55 am

Re: New plugin/check with NRPE - no output

Post 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!
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: New plugin/check with NRPE - no output

Post 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?
Former Nagios employee
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: New plugin/check with NRPE - no output

Post 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.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked