nrpe 2.15 - nagios 3.5.1 problem -> wrong parameter list

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
Mike_J
Posts: 3
Joined: Sun Dec 21, 2014 11:00 pm

nrpe 2.15 - nagios 3.5.1 problem -> wrong parameter list

Post by Mike_J »

I installed nagios 3.5.1 on ubuntu 14.04 (apt-get install nagios3, apt-get install nagios-nrpe-plugin). On a remote ubuntu 14.04 server, I installed nrpe-server (apt-get install nagios-nrpe-server). There seems to be a problem when not passing arguments. (Or maybe I'm missing something obvious)

I see these error messages in the web gui - CHECK_NRPE: Received 0 bytes from daemon. Check the remote server logs for error messages.

config sample on master: my.server.cfg has this service defined:

Code: Select all

define service{
        use                             generic-service         ; Name of service template to use
        host_name                       Server1
        service_description             Disk Space
        check_command                   check_nrpe!check_disk1
        }
config on remote server:

Code: Select all

dont_blame_nrpe=0
command[check_disk1]=/usr/lib/nagios/plugins/check_disk -w 20% -c 10% -p /dev/hda1
From the command line, it works:

Code: Select all

$  /usr/lib/nagios/plugins/check_nrpe -H my.ip.add.ress -c check_disk1
DISK OK - free space: / 46920 MB (97% inode=97%);| /=1194MB;40208;45234;0;50260
I turned on debug on the master and I see this in the nagios.debug log:

Code: Select all

**** BEGIN MACRO PROCESSING ***********
Processing: '/usr/lib/nagios/plugins/check_nrpe -H $HOSTADDRESS$ -c $ARG1$ -a $ARG2$'
Done.  Final output: '/usr/lib/nagios/plugins/check_nrpe -H my.ip.add.ress -c check_disk1 -a '
**** END MACRO PROCESSING *************
NOTE that there is a '-a' at the end of the output line. Why is that? When I cut and paste that to a command line, the check fails:

Code: Select all

$ /usr/lib/nagios/plugins/check_nrpe -H my.ip.add.ress -c check_disk1 -a
/usr/lib/nagios/plugins/check_nrpe: option requires an argument -- 'a'
AND that is the problem. How do I stop nagios from putting "-a" at the end of the command when I'm not passing any parameters?
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: nrpe 2.15 - nagios 3.5.1 problem -> wrong parameter list

Post by lmiltchev »

You are trying to pass an argument:
/usr/lib/nagios/plugins/check_nrpe -H my.ip.add.ress -c check_disk1 -a
Processing: '/usr/lib/nagios/plugins/check_nrpe -H $HOSTADDRESS$ -c $ARG1$ -a $ARG2$'
that's why it is failing. You cannot pass arguments as on the remote server, in the nrpe.cfg, you have:

Code: Select all

dont_blame_nrpe=0
Try running from the CLI on the nagios server:

Code: Select all

/usr/lib/nagios/plugins/check_nrpe -H my.ip.add.ress -c check_disk1
This should work.

Is the "check_nrpe" command defined with a "-a" flag?
Be sure to check out our Knowledgebase for helpful articles and solutions!
Mike_J
Posts: 3
Joined: Sun Dec 21, 2014 11:00 pm

Re: nrpe 2.15 - nagios 3.5.1 problem -> wrong parameter list

Post by Mike_J »

You can see in my original post - i tried your suggestion and it worked. Why is the nagios macro processing the command with "-a" when I don't have any parameters in the nagios cfg file?

Master server cfg snippet:
check_service check_nrpe!check_disk1 <=== NOTE: no parameters for check_disk1

What am I missing?
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: nrpe 2.15 - nagios 3.5.1 problem -> wrong parameter list

Post by lmiltchev »

Can you show us the "check_nrpe" command definition?
Be sure to check out our Knowledgebase for helpful articles and solutions!
Mike_J
Posts: 3
Joined: Sun Dec 21, 2014 11:00 pm

Re: nrpe 2.15 - nagios 3.5.1 problem -> wrong parameter list

Post by Mike_J »

Thanks for pointing me in the right direction. There is a check_nrpe_1arg definition as well as a check_nrpe in /etc/nagios-plugins/config/check_nrpe.cfg. When I changed my server cfg file to use check_nrpe_1arg, everything began to work.

Thanks again!
Locked