Error message for failed NRPE checks

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
Fred Kroeger
Posts: 588
Joined: Wed Oct 19, 2011 11:36 pm
Location: Perth, Western Australia
Contact:

Error message for failed NRPE checks

Post 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
User avatar
cdienger
Support Tech
Posts: 5045
Joined: Tue Feb 07, 2017 11:26 am

Re: Error message for failed NRPE checks

Post 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.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Locked