NRPE: Unable to read output

I have looked around and found that I should edit the premissions to the plugin to solve this.
-rw-r–r-x 1 root root 34539 Feb 21 10:51 check_disk
I have NRPE running on other boxes but this one box is being a pain I have all nrpe files with same premision as other like monitored boxes any ideas where else to check?
Thanks :evil:

Sorry I should have added some more particulars.
This is running on redhat el4
nagios-nrpe-2.3-1.2.el4.rf.i386
There is no compiler so I had to use RPM.

Make sure the command you want to execute in the remote machine is well defined there.

That output is usually returned when nrpe does not have the command you asked using “-c” argument.

bye.

I run this manually
./check_nrpe -H 10.76.16.29 -n -p 5666 -c check_disk1 /dev/cciss/c0d0p1
and get this
NRPE: Unable to read output

Show me, please , how is defined check_disk1 in nrpe.cfg in the remote host

/etc/nagios
command[check_disk1]=/usr/lib/nagios/plugins/check_disk!20%!10%!/dev/cciss/c0d0p1
Thank you

Are you sure that the plugin is in the lib not in libexec directory. Becuase if it’s a typo it will not work.

I have all my check commands in a libexec directory.

Check your typing carefully as that get’s me in trouble alot times.

Looks like you’re using the commands wherein the check is being run with arguments. The default configuration of the NRPE daemon is to not allow them. This is why the nrpe.cfg file lists the two ways to do it. I believe this to be your problem. If you don’t use a specific option when running ./configure, you won’t be able to use arguments in your command definitions in nrpe.cfg.

Get rid of the /dev/cciss/c0d0p1 bit in the command:
./check_nrpe -H 10.76.16.29 -n -p 5666 -c check_disk1

It should already defined with arguments on the remote host:

command[check_disk1]=/usr/lib/nagios/plugins/check_disk -w 20% -c 10% -x /dev/cciss/c0d0p1

I tryied this
./check_nrpe -H 10.76.16.29 -n -p 5666 -c check_disk1
NRPE: Unable to read output
Still get the error I am learning a lot from you all about NRPE so Thank you. So since I dont send the whole thing how do I write this in the bigger.txt? #define service definition
define service {

use generic-service ; Name of service template to use

    host_name                       OH-CL-SYSLOG1
    service_description             /dev/cciss/c0d0p5 Syslog Free Space
    is_volatile                     0
    check_period                    24x7
    max_check_attempts              3
    normal_check_interval           5
    retry_check_interval            1
    contact_groups                  Operations
    notification_interval           120
    notification_period             24x7
    notification_options            c,r
    check_command                   check_nrpe!check_disk1!20%!10%!/dev/cciss/c0d0p5

check_command check_nrpe

    }

I truned off the allow arguments

Okay, your problem is with the check_command field. It should read like this:

check_command check_nrpe!5666!check_disk1

Then, in checkcommands.cfg, you’ll need this:

define command{
command_name check_nrpe
command_line /usr/local/nagios/libexec/check_nrpe -H $HOSTADDRESS$ -p $ARG1$ -c $ARG2$
}

Then, in nrpe.cfg on the remote host, use the first definition of the check_disk1 command, editing the path to suit the partition you’re trying to check. Comment out the second check_disk1 definition. Then restart NRPE on the remote host and Nagios on your Nagios machine. See what happens.

The command should be defined in nrpe.cfg like this:

command[check_disk1]=/usr/lib/nagios/plugins/check_disk -w 20% -c 10% -p /dev/cciss/c0d0p1

And you should run this command line on nagios box:

./check_nrpe -H 10.76.16.29 -n -p 5666 -c check_disk1

And in the service definition file, dont place arguments:

define service {

use generic-service ; Name of service template to use

host_name OH-CL-SYSLOG1
service_description /dev/cciss/c0d0p5 Syslog Free Space
is_volatile 0
check_period 24x7
max_check_attempts 3
normal_check_interval 5
retry_check_interval 1
contact_groups Operations
notification_interval 120
notification_period 24x7
notification_options c,r
check_command check_nrpe!check_disk1

check_command check_nrpe

}

OK in my bigger.cfg I have
#define service definition
define service {

use generic-service ; Name of service template to use

    host_name                       OH-CL-SYSLOG1
    service_description             /dev/cciss/c0d0p5 Syslog Free Space
    is_volatile                     0
    check_period                    24x7
    max_check_attempts              3
    normal_check_interval           5
    retry_check_interval            1
    contact_groups                  Operations
    notification_interval           120
    notification_period             24x7
    notification_options            c,r
    check_command                   check_nrpe!5666!check_disk1
    }

in the checkcommands.cfg i have

‘check_nrpe’ command definition

define command {
command_name check_nrpe
command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -p $ARG1$ -c $ARG2$
}
I execute
/usr/lib/nagios/plugins/check_nrpe -H 10.76.16.77 -n -p 5666 -c check_disk1
DISK OK - free space: /var/log/clients 504636 MB (74%);| /var/log/clients=180872MB;548405;616956;0;685507
manually and it works. I really think I have the nagios side right thanks to you guys.
on the nrpe side I have in the nrpe.cfg
If I uncomment this
#allowed_hosts=10.76.16.148 I get an error.

dont_blame_nrpe=0
command[check_disk1]=/usr/lib/nagios/plugins/check_disk -w 20% -c 10% -p /dev/cciss/c0d0p5
nrpe[27561]: Could not read request from client, bailing out…
Sorry to be so slow but I really appreciate your help.

Why don’t you set the allowed host field to the IP of your Nagios box?

The arguments are processed on the remote host. Your still using arguments in the Service definition on Nagios server:

check_command check_nrpe!check_disk1!20%!10%!/dev/cciss/c0d0p5

You just want:
check_command check_nrpe!check_disk1

And then on the remote host in the nrpe.cfg file you want the arguments, all you want to call is the command name which in this case is “check_disk1”:

command[check_disk1]=/usr/lib/nagios/plugins/check_disk -w 20% -c 10% -x /dev/cciss/c0d0p1

Sorry was reading from bottom of 1st page!

When I have the command like this
check_nrpe!5666!check_disk1
CHECK_NRPE: Socket timeout after 10 seconds.
When it like this
I get this
check_command check_nrpe!check_disk1
I get this
Incorrect command line arguments supplied
This is what I have in the NRPE.cfg
command[check_disk1]=/usr/lib/nagios/plugins/check_disk -w 20% -c 10% -x /dev/cciss/c0d0p5

The README file with nrpe seems very precise.
This is the check command definition on the nagios server:
An example
command definition for the check_nrpe plugin would look like this:

define command{
command_name check_nrpe
command_line /usr/local/nagios/libexec/check_nrpe -H $HOSTADDRESS$ -c $ARG1$

This is the service definition on the nagios server:
define service{
host_name someremotehost
service_description someremoteservice
check_command check_nrpe!yourcommand
… etc …
}
where “yourcommand” is a name of a command that you define in
your nrpe.cfg file on the remote host (see the docs in the
sample nrpe.cfg file for more information).

This is from the nrpe.cfg sample file that is located on the remote host.
command[check_disk1]=/usr/local/nagios/libexec/check_disk -w 20 -c 10 -p /dev/hda1

So, for your case, it should be easy to check /dev/cciss/c0d0p5

On nagios server checkcommands.cfg:
define command{
command_name check_nrpe
command_line /usr/local/nagios/libexec/check_nrpe -H $HOSTADDRESS$ -c $ARG1$

On nagios server services.cfg:
define service{
host_name OH-CL-SYSLOG1
service_description c0d0p5_free_space
check_command check_nrpe!check_disk1
… etc …
}

On remote host OH-CL-SYSLOG1 in nrpe.cfg file:
command[check_disk1]=/usr/local/nagios/libexec/check_disk -w 20 -c 10 -p /dev/cciss/c0d0p5

I am still having problems I setup everything like you all have told me but I still have an issue with the nrpe.cfg
I have this

SERVER ADDRESS

Address that nrpe should bind to in case there are more than one interface

and you do not want nrpe to bind on all interfaces.

NOTE: This option is ignored if NRPE is running under either inetd or xinetd

server_address=10.76.16.77

allowed_hosts=10.76.16.148

The error log is giving this message.
Mar 3 11:16:13 oh-cl-syslog.sai nrpe[2989]: Unknown option specified in config file ‘/etc/nagios/nrpe.cfg’ - Line 38

line 38 is the
allowed_hosts=10.76.16.148
I have installed this via an RPM I would have compiled from source but the companies security policy does not allow for compilers big pain.
I added the allow host line, the RPM version did not include it. What do you think I should do?
Thank you