Page 1 of 1

Error message for failed NRPE checks

Posted: Fri May 31, 2019 2:47 am
by Fred Kroeger
Hi - Got a strange message displayed for my NRPE checks when I stop the nsclient service.

Running the check from the command line , the output is as expected

Code: Select all

# /usr/local/nagios/libexec/check_nrpe -H 192.168.11.82
connect to address 192.168.11.82 port 5666: Connection refused
connect to host 192.168.11.82 port 5666: Connection refused
However, the Status Information displayed in the Nagios screen has an error message (No output on stdout) stderr: prefixed to the start of the command output. This happens on all the checks run via check_nrpe after the nsclient service is stopped. Interestingly enough, that error string is not displayed for check_nt commands.

Code: Select all

Service                       Status     Duration   Attempt  Last Check            Status Information
Check NRPE Agent - Windows	Critical	10m 54s	5/5	31/05/2019 17:08:47	(No output on stdout) stderr: connect to address 192.168.11.82 port 5666: Connection refused
Is there any way of getting rid of that error string as it is meaningless and just confuses the people reading the notification.
I'm running NagiosXI 5.6.2.

Thanks.... Fred

Re: Error message for failed NRPE checks

Posted: Fri May 31, 2019 12:32 pm
by cdienger
The message/logic to display the standard error and standard output is in Core's source code and hence not easily changed. What we can do as a work around is redirect check_nrpe's standard error to the standard out by editing the check_nrpe command under Configure > Core Config > Manager > Commands > _Commands to look something like:

Code: Select all

$USER1$/check_nrpe -H $HOSTADDRESS$ -t 30 -c $ARG1$ $ARG2$ 2>&1
This should make it so that only the standard error(the "connection refused" message) is seen in cases like this.