Page 1 of 1

NRPE: Unable to read output

Posted: Tue Apr 08, 2025 8:11 am
by Pratapa
Hi,

We are using Nagios core 4.4.4

On one of the remote servers which is a Linux server we are getting error "NRPE: unable to read output" for all the services.

When we execute the following command on remote machine we are getting "NRPE: unable to read output"

$ ./check_nrpe -H localhost -c check_mailq
NRPE: unable to read output

Following is the entry in nrpe.cfg

command[check_mailq]=/usr/bin/sudo /usr/local/nagios/libexec/check_linux_mailq.bash -w $ARG1$ -c $ARG2$

$ ls -l /usr/local/nagios/libexec/check_linux_mailq.bash
-rwxrwxrwx. 1 nagios nagios 1087 Apr 7 14:57 /usr/local/nagios/libexec/check_linux_mailq.bash

We don't see any permission issue.

nrpe is running.

telnet <hostname> 5666 ---- connecting.

What could be the problem.

Re: NRPE: Unable to read output

Posted: Tue Apr 08, 2025 6:18 pm
by kg2857
You need to provide the -w and -c values as shown in the command.

Re: NRPE: Unable to read output

Posted: Wed Apr 09, 2025 6:13 am
by Pratapa
$pwd
/usr/local/nagios/libexec
$./check_nrpe -H localhost -c check_mailq -a 10 20
NRPE: Unable to read output

Still the same.

Re: NRPE: Unable to read output

Posted: Wed Apr 09, 2025 10:39 pm
by kg2857
As the nagios user run:
/usr/bin/sudo /usr/local/nagios/libexec/check_linux_mailq.bash -w 10 -c 20
You might try removing the -a too.
You could try some troubleshooting steps on your own as well.