NRPE Newbie


#1

Just installed Nagios and NRPE. I’m trying to get remote command arguments working, but continue to get “no response from plugin” displayed in the Nagios Web Interface. The below command returns appropriate output when run from the command line of the monitoring host as user “Nagios”

/usr/local/nagios/libexec/check_nrpe -H -c check_disk -a 10% 20% /dev/sda1

NRPE was compiled with the --enable-command-args option, and I’ve set the don’t_blame_nrpe directive to “1” in the nrpe.cfg file on the remote host. Below is an excerpt of the nrpe.cfg file on the remote host:

command[check_disk]=/usr/local/nagios/libexec/check_disk -w $ARG1$ -c $ARG2$ -p $ARG3$

I added the following command to the /usr/local/nagios/etc/object/commands.cfg file:

'check_nrpe command definition

define command{
command_name check_nrpe
command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -C $ARG1$
}

Below is my object configuration file /usr/local/nagios/etc/objects/linuxhosts.cfg (I added the path to this file in the nagios.cfg file)

define host {
name linux-box ; Name of this template
use generic-host ; Inherit default values
check_period 24x7
check_interval 5
retry_interval 1
max_check_attempts 10
check_command check-host-alive
notification_period 24x7
notification_interval 30
notification_options d,r
contact_groups admins
register 0 ; DONT REGISTER THIS - ITS A TEMPLATE
}
define host {
use linux-box
host_name 10.1.10.51
alias 10.1.10.51
address 10.1.10.51
}
define service{
use generic-service
host_name 10.1.10.51
service_description /dev/sda1 Free Space
check_command check_nrpe!check_disk!20%!10%!/dev/sda1
}

The web interface shows the host alive but the service detail continues to show “no response from plugin”. I’m guessing that I’m missing something very basic, but this is getting a little frustrating. Please help if you can.

Thanks,

Mark.


#2

Figured it out on my own:

  1. Somehow I managed to have a capital “C” in my command definition, should be:
    command_line $USER$!/check_nrpe -H $HOSTADDRESS$ -c $ARG1$

  2. And to enable command arguments the above needs to be:
    command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c $ARG1$ -a $ARG2$ $ARG3$ $ARG4$

Thanks for looking.

Mark.