Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

OS: Ubuntu 12.10 Server 64bits

I've installed Icinga, with ido2db, pnp4nagios and icinga-web (last release, following the instruction given in the documentation, installation with apt, etc). I am using icinga-web to monitor my hosts. For the moment, I have just my localhost, and all is perfect.

I am trying to add a host and monitor it with NRPE (version 2.12):

root@server:/etc/icinga# /usr/lib/nagios/plugins/check_nrpe -H client
NRPE v2.12

The configuration looks good.

I've created a file in /etc/icinga/objects/client.cfg as below on the server:

root@server:/etc/icinga/objects# cat client.cfg
define host{
 use generic-host ; Name of host template to use
 host_name client
 alias client.toto
 address xx.xx.xx.xx
 }

# Service Definitions
define service{
 use generic-service
 host_name client
 service_description CPU Load
 check_command check_nrpe_1arg!check_load
 }

define service{

 use generic-service
 host_name client
 service_description Number of Users
 check_command check_nrpe_1arg!check_users
 }

And add in my /etc/icinga/commands.cfg:

# this command runs a program $ARG1$ with no arguments
define command {
 command_name check_nrpe
 command_line /usr/lib/nagios/plugins/check_nrpe -H $HOSTADDRESS$ -c $ARG1$ -a $ARG2$
}

# this command runs a program $ARG1$ with no arguments
define command {
 command_name check_nrpe_1arg
 command_line /usr/lib/nagios/plugins/check_nrpe -H $HOSTADDRESS$ -c $ARG1$
}

But it does not work.

These are the logs from the client:

Dec 3 19:45:12 client nrpe[604]: Connection from xx.xx.xx.xx port 32641
Dec 3 19:45:12 client nrpe[604]: Host address is in allowed_hosts
Dec 3 19:45:12 client nrpe[604]: Handling the connection...
Dec 3 19:45:12 client nrpe[604]: Host is asking for command 'check_users' to be run...
Dec 3 19:45:12 client nrpe[604]: Running command: /usr/lib/nagios/plugins/check_users -w -c
Dec 3 19:45:12 client nrpe[604]: Command completed with return code 3 and output: check_users: Warning t hreshold must be a positive integer#012Usage:check_users -w  -c 
Dec 3 19:45:12 client nrpe[604]: Return Code: 3, Output: check_users: Warning threshold must be a positive integer#012Usage:check_users -w  -c 

Dec 3 19:44:49 client nrpe[32582]: Connection from xx.xx.xx.xx port 32129
Dec 3 19:44:49 client nrpe[32582]: Host address is in allowed_hosts
Dec 3 19:44:49 client nrpe[32582]: Handling the connection...
Dec 3 19:44:49 client nrpe[32582]: Host is asking for command 'check_load' to be run...
Dec 3 19:44:49 client nrpe[32582]: Running command: /usr/lib/nagios/plugins/check_load -w -c
Dec 3 19:44:49 client nrpe[32582]: Command completed with return code 3 and output: Warning threshold mu st be float or float triplet!#012#012Usage:check_load [-r] -w WLOAD1,WLOAD5,WLOAD15 -c CLOAD1,CLOAD5,CLO AD15
Dec 3 19:44:49 client nrpe[32582]: Return Code: 3, Output: Warning threshold must be float or float trip let!#012#012Usage:check_load [-r] -w WLOAD1,WLOAD5,WLOAD15 -c CLOAD1,CLOAD5,CLOAD15
Dec 3 19:44:49 client nrpe[32582]: Connection from xx.xx.xx.xx closed.

Have you any ideas?

share|improve this question

2 Answers 2

If you look at the receiver check_user scripting you will notice that there are required parameters that MUST be passed. The log clearly indicates this and the expected format. You might look also look at the nrpe man page as well. You might look at the nagios core documentation available on the website. Finally notice how check_user script is called by examining the nrpe.cfg script example (probably in /etc/nagios).

share|improve this answer

For others who seek. I believe that the asker must already have found the solution

comment out the lines in / etc / nagios / nrpe.cfg

# The following examples allow user-supplied arguments and can
# only be used if the NRPE daemon was compiled with support for 
# command arguments *AND* the dont_blame_nrpe directive in this
# config file is set to '1'.  This poses a potential security risk, so
# make sure you read the SECURITY file before doing this.

#command[check_users]=/usr/lib/nagios/plugins/check_users -w $ARG1$ -c $ARG2$
#command[check_load]=/usr/lib/nagios/plugins/check_load -w $ARG1$ -c $ARG2$
#command[check_disk]=/usr/lib/nagios/plugins/check_disk -w $ARG1$ -c $ARG2$ -p $ARG3$
#command[check_procs]=/usr/lib/nagios/plugins/check_procs -w $ARG1$ -c $ARG2$ -s $ARG3$
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.