Nagios Check_nrpe no output returned from plugin in Nagios but works in the terminal

Dave picture Dave · Apr 19, 2012 · Viewed 9.9k times · Source

I am looking for a little help in configuring NAGIOS for NRPE. I am quite new at Linux and seem to be having some trouble getting this working. I am running Ubuntu 11.10 with the Nagios 3.3.1 core and Nagios plugins 1.4.15 running nrpe2.13
Currently I am trying to get the Nagios Exchange plugin check_be.exe to work with Nagios. I followed the check_be.txt for the setup on my nagios server and windows backup exec server.

Currently if I run

root@PERSES:/usr/local/nagios/libexec# ./check_nrpe -H 192.168.1.10 -t200 -c check_be   

I will get

Job: Daily Backup, Success, Date:17/4/2012

From Nagios all I get is no output returned from plugin.

Windows.cfg has the following entry

# Service for Backup Exec agent
define service {
  use                 template-backupexec
  service_description BackupExec - Daily DAT backup   ; specific display name, if you need
  host_name           cmbssrv.cmbs.local
  }

Templates.cfg has this entry – I have tried to modify it to avoid the socket timeout

define service{
 name                  template-backupexec
  use                   generic-service
 service_description   BackupExec Job Check    ; default display name in Nagios
  check_command         check_nrpe! -t 240 -c check_be  ; same name as in the nsclient++ nsc.ini     command defini$
  normal_check_interval 60                      ; your check intervals here
   retry_check_interval  60
 register 0                                    ; this is a template
  }

Commands.cfg:

# 'check_nrpe' command definition
  define command{
          command_name    check_nrpe
          command_line    $USER1$/check_nrpe -H $HOSTADDESS$ -p 5666 -v $ARG1$
          }

Any ideas would be greatly appreciated

Answer

a9k picture a9k · May 3, 2012

This looks wrong

  check_command check_nrpe! -t 240 -c check_be

I think those extra arguments need to be in the define command block.

Also change the name of the check_command. You may confuse the check_nrpe executable command (runs in terminal) with your check_command of the same name (which is unknown to the terminal shell).

Here's a working example much like what you are doing.

On the main nagios machine:

define command {
  command_name  check_nrpe_cart
  command_line  /usr/lib/nagios/plugins/check_nrpe -H $HOSTADDRESS$ -p 6565 -c $ARG1$
}
define service{
  use                    clientcritical
  host_name              cartbox
  service_description    email
  normal_check_interval  15
  check_command          check_nrpe_cart!check_postfix
}

On cartbox in /etc/nagios/nrpe_local.cfg

command[check_postfix]=/usr/lib/nagios/plugins/check_procs -w 1:1 -c 1:1 -C master