Share, , Google Plus, Pinterest,

Print

Posted in:

NRPE: Unable to read output – Nagios error

Why am i getting “NRPE: Unable to read output”?

Usually this is a configuration error on Nagios client side. It is a problem in check command definition in “nrpe.cfg” file on Nagios client. If you see this error you probably defined a check command calling a Nagios Plugin file which does not exist.

UPDATE: If you installed your NRPE client from RPM, nrpe.cgf file is located at /etc/nagios/nrpe.cfg.

How to fix “NRPE: Unable to read output” error?

1. Check configuration

First check Nagios service configuration for “CLUSTER state” on the server side:

define service{
        use                             geek-service
        host_name                       foo1.geekpeek.net
        service_description             CLUSTER state
        check_command                   check_nrpe!check_cluster
        contact_groups                  geek-admin
}

check_command” line tells us we must find “check_cluster” command definition on Nagios client!

2. Find command definition

Next find “check_cluster command definition in “nrpe.cfg” on the Nagios client side:

...
command[check_cluster]=/usr/lib64/nagios/plugins/check_crmd
...

3. Run command

Manually run defined “check_crmd” command on Nagios client:

[root@fooclient ~]# /usr/lib64/nagios/plugins/check_crmd
-bash: /usr/lib64/nagios/plugins/check_crmd: No such file or directory

Clearly “check_crmd” file is missing.

4. Run fixed

Correct the “check_cluster” definition by calling the correct Nagios plugin file (in our case /usr/lib64/nagios/plugins/check_crm) and manually run command again:

[root@fooclient ~]# /usr/lib64/nagios/plugins/check_crm
check_crm OK - Cluster OK

Great this solved it!

5. Edit nrpe.cfg

Edit “nrpe.cfg” file to run the correct Nagios plugin

...
command[check_cluster]=/usr/lib64/nagios/plugins/check_crm
...

6. Restart NRPE service

Restart NRPE service on Nagios client for changes to take effect!

In our case the problem was a spelling mistake when configuring NRPE service on Nagios client, but sometimes this kind of problem can arise from a missing Nagios plugin installation. If you are missing a Nagios plugin you will need to find it and install it.

Also make sure to make manual service checks by running the plugins locally on your Nagios client machine. It is always wise to first make manual checks on Nagios client and next manual checks from Nagios server. In the end you can edit the NRPE configuration file and restart NRPE service.

  • Brett

    I’d be helpful if you state where the nrpe.cfg file should be

    • Mitch

      Hi Brett! Yes, you are right, the nrpe.cfg location should be stated and i will update the post immediately! Thanks for the info 🙂 Regards, Mitch

      • miguel

        find / -name nrpe.cfg -ls

  • jeffgrant36

    Hi, I can’t believe this is from so many years ago, but it definitely helped! Thanks!