Page 1 of 3

NRPE Socket Timeout when running check that loads PSSNapin f

Posted: Tue May 19, 2015 3:33 pm
by ads1923
We have a Nagios Core server that is showing "CHECK_NRPE: Socket timeout after 30 seconds" on checks that require the Exchange pssnapin to load. The scripts run correctly and quick locally on the Exchange server and other NRPE checks run fine on the server like alias_cpu and alias_disk. The checks that fail on the Exchange server succeed on other Exchange servers. I have copied the script (https://exchange.nagios.org/directory/P ... es/details) and the nsclient.ini file from a working server and still have the issue. The nsclient.log on the server that is not working shows this: "e:c:\build\nscp\include\socket/connection.hpp:146: Failed to send data: The file handle supplied is not valid"

One fix that we have done to get some of the servers to work was to not require "Check for publisher's certificate revocation" in internet options.

The command that I am using on the Nagios server command line to test is: ./check_nrpe -H hostname.domain -c check_queue_health -t 30
The nsclient.ini file has this:

; NSClient server - A simple server that listens for incoming NSClient (check_nt) connection and handles them. Although NRPE is the preferred method NSClient is fully supported and can be used for simplicity or for compatibility.
NSClientServer = 1

; Undocumented section
[/settings/external scripts/scripts]
check_queue_health=cmd /c echo Scripts\QueueHealth.ps1 | PowerShell.exe -Command -


; Undocumented section
[/settings/default]

This is happening on Exchange 2007 SP3 UR 16 servers on Windows 2008 R2 SP1 and Exchange 2013 SP1 UR8 on Server 2012 R2
Any ideas on what else to try?

Thanks

Re: NRPE Socket Timeout when running check that loads PSSNap

Posted: Tue May 19, 2015 4:45 pm
by tgriep
In your nsclient.ini file, do you have the NRPE server enabled? Make sure the following is set in the file. If it isn't change it and restart the NSClient++ service.

Code: Select all

NRPEServer = 1

Re: NRPE Socket Timeout when running check that loads PSSNap

Posted: Tue May 19, 2015 4:52 pm
by ads1923
Yes, the NRPEServer is enabled:
; NRPE server - A simple server that listens for incoming NRPE connection and handles them.
NRPEServer = 1

And this is set at the bottom of the .ini file:

; Section for NRPE (NRPEListener.dll)
[/settings/NRPE/server]
allow arguments = 1
allow nasty_meta chars = 1
allowed hostes = 10.10.10.10,10.10.10.20
port = 5666
use SSL = 1

Also other ./check_nrpe tests do work on the servers in question

Re: NRPE Socket Timeout when running check that loads PSSNap

Posted: Tue May 19, 2015 6:56 pm
by Box293
On the other servers where this script works, is the NSClient++ service running as a defined user account, instead of "Local System account"?

Also, is the version of NSClient++ the same on both servers?

Re: NRPE Socket Timeout when running check that loads PSSNap

Posted: Tue May 19, 2015 7:01 pm
by ads1923
The nsclient service is running as local system on all of the servers and the client is all the same version.
nsclient version 4.1.105

Re: NRPE Socket Timeout when running check that loads PSSNap

Posted: Tue May 19, 2015 7:14 pm
by Box293
This might generate more helpful information:

From a command prompt:

Code: Select all

"C:\Program Files\NSClient++\nscp.exe" test
Wait until it says "Enter command to inject"

Then type:

Code: Select all

check_queue_health
This should output more information about what is happening.

When done, type:

Code: Select all

exit

Re: NRPE Socket Timeout when running check that loads PSSNap

Posted: Wed May 20, 2015 9:39 am
by tgriep
One thing to try is to increase the timeout for your check. Try running the following in the Nagios XI server to see if that resolves the issue.

Code: Select all

./check_nrpe -H hostname.domain -c check_queue_health -t 45
Could you also post your full nsclient.ini file?

Re: NRPE Socket Timeout when running check that loads PSSNap

Posted: Wed May 20, 2015 10:24 am
by ads1923
@box293 the check runs fine on the local machine it just doesn't seem to send the response back to the Nagios server.

Here is what the test output looks like:

d rvice\NSClient++.cpp:616 NSClient++ - 0,4,1,105 2014-04-28 Started!
l ce\simple_client.hpp:32 Enter command to inject or exit to terminate...
check_queue_health
d rvice\NSClient++.cpp:960 Injecting: check_queue_health...
d kExternalScripts.cpp:249 Command line: cmd /c echo Scripts\QueueHealth.ps1 | PowerShell.exe -Command -
d rvice\NSClient++.cpp:985 Result check_queue_health: OK
l ce\simple_client.hpp:80 OK:OK: All mail queues within limits.
exit

Re: NRPE Socket Timeout when running check that loads PSSNap

Posted: Wed May 20, 2015 10:26 am
by ads1923
@tgriep

I have tried to increase the timeout value and I get the same result.

Re: NRPE Socket Timeout when running check that loads PSSNap

Posted: Wed May 20, 2015 10:31 am
by ads1923
Here is the nsclient.ini file