Nagios/NRPE giving a "No output returned from plugin" error
Asked Answered
A

2

5

Getting a "No output returned from plugin" error message from a Nagios/NRPE script

1) Running Nagios v3.2.3 and NRPE v2.12

2) The script:

   OK_STATE=0
   UNAME=/bin/uname -r       
   echo "OK: Kernel Version=$UNAME"       
   exit $OK_STATE

2) Command line results on the Nagios Server using NRPE

  • Same OK results for both the root and nagios users:

[nagios@cmonmm03 libexec]$ ./check_nrpe -H dappsi01b.dev.screenscape.local -c check_kernel OK: Kernel Version=2.6.18-194.11.3.el5

When I run the check_kernel.sh script on the machine's local command line it works there to.

Help, any thoughts or known solution regarding this would be appreciated?

Thank you

Ahner answered 28/10, 2010 at 15:59 Comment(0)
A
8

Your command does not take any arguments, but it is likely the command definition for check_nrpe does define an argument parameter, for example:

define command{
    command_name    check_nrpe
    command_line    /usr/lib64/nagios/plugins/check_nrpe -H $HOSTADDRESS$ -c $ARG1$ -a $ARG2$
}

Therefore, try placing a dummy argument in the service definition:

define service{
    use                             normal-service
    host_name                       hostname
    service_description             Description
    check_command                   check_nrpe!check_foo!placeholder
}
Alain answered 4/12, 2011 at 8:39 Comment(1)
This is exactly the same issue I had. On my default Ubuntu install, there was even a command (in /etc/nagios-plugins/config/check_nrpe.cfg) called check_nrpe_1arg, so I just used that. Defined as: define command { command_name check_nrpe_1arg command_line /usr/lib/nagios/plugins/check_nrpe -H $HOSTADDRESS$ -c $ARG1$ }Tades
S
0

Did you add the nagios host to the /etc/xinetd.nrpe.cfg file? Specifically, the only_from line typically includes the localhost (on the remote system). Make sure to add the IPs of your nagios host there as well:

# default: on
# description: NRPE (Nagios Remote Plugin Executor)
service nrpe
{
    flags           = REUSE
    socket_type     = stream
    port            = 5666
    wait            = no
    user            = nagios
    group           = nagios
    server          = /usr/local/nagios/bin/nrpe
    server_args     = -c /usr/local/nagios/etc/nrpe.cfg --inetd
    log_on_failure  += USERID
    disable         = no
    only_from       = 127.0.0.1 192.168.1.61
}
Scilla answered 2/3, 2011 at 17:33 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.