NRPE Socket Timeout when running check that loads PSSNapin f

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
User avatar
tgriep
Madmin
Posts: 9177
Joined: Thu Oct 30, 2014 9:02 am

Re: NRPE Socket Timeout when running check that loads PSSNap

Post by tgriep »

Try changing the command in the nsclient.ini to the following to see if this fixes it for you.

Code: Select all

check_queue_health=cmd /c echo scripts\QueueHealth.ps1; exit $LastExitCode | PowerShell.exe -Command -
Be sure to check out our Knowledgebase for helpful articles and solutions!
ads1923
Posts: 12
Joined: Mon Jun 09, 2014 6:07 pm

Re: NRPE Socket Timeout when running check that loads PSSNap

Post by ads1923 »

Thank you for the replies. I updated the nsclient.ini file with this: check_queue_health=cmd /c echo scripts\QueueHealth.ps1; exit $LastExitCode | PowerShell.exe -Command -

I ran nscp.exe test
check_queue_health

The local server reported:

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; exit $LastExitCode | 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

When I run this: ./check_nrpe -H nwk-mbx13p-w02.pex.exch.apple.com -c check_queue_health -t 30 from the Nagios server I get the same result as before
CHECK_NRPE: Socket timeout after 30 seconds.
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: NRPE Socket Timeout when running check that loads PSSNap

Post by ssax »

At the bottom of your nsclient.ini

Remove:

Code: Select all

allowed hostes = 10.10.10.10, 10.10.10.20
Change:

Code: Select all

allow nasty_meta chars = 1
To:

Code: Select all

allow nasty characters = 1
Restart your nsclient service and try it again.
ads1923
Posts: 12
Joined: Mon Jun 09, 2014 6:07 pm

Re: NRPE Socket Timeout when running check that loads PSSNap

Post by ads1923 »

I made the changes to the nsclient.ini file that you suggested and I get the same result.

CHECK_NRPE: Socket timeout after 30 seconds.
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: NRPE Socket Timeout when running check that loads PSSNap

Post by Box293 »

On your Windows server run these commands:

Code: Select all

cd "\Program Files\NSClient++\" 
nscp settings --activate-module NSClientServer --add-defaults 
nscp settings --path /settings/log --key level --set debug
Restart the NSClient++ Service.

Now go and perform:
ads1923 wrote:When I run this: ./check_nrpe -H nwk-mbx13p-w02.pex.exch.apple.com -c check_queue_health -t 30 from the Nagios server I get the same result as before
CHECK_NRPE: Socket timeout after 30 seconds.
After it completes post the results from the nsclient.log file created.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
ads1923
Posts: 12
Joined: Mon Jun 09, 2014 6:07 pm

Re: NRPE Socket Timeout when running check that loads PSSNap

Post by ads1923 »

I followed your steps and ran the command from the nagios server. Attached is the nsclient.log that you requested.

I still get the same response on the nagios server. Just a reminder i have 3 other servers in these subnet that are working using the same nsclient.ini file and external scripts.

output from the nagios server:
CHECK_NRPE: Socket timeout after 30 seconds.
Attachments
nsclient.log
(12.91 KiB) Downloaded 387 times
User avatar
tgriep
Madmin
Posts: 9177
Joined: Thu Oct 30, 2014 9:02 am

Re: NRPE Socket Timeout when running check that loads PSSNap

Post by tgriep »

It looks like the command is taking longer than 30 seconds to run, try changing the timeout to 59 seconds to see if that works for you.
Be sure to check out our Knowledgebase for helpful articles and solutions!
ads1923
Posts: 12
Joined: Mon Jun 09, 2014 6:07 pm

Re: NRPE Socket Timeout when running check that loads PSSNap

Post by ads1923 »

I have tried to increase the timeout value before and it still fails, it fails with a different message though.

Command ran on the Nagios server:
./check_nrpe -H servername.domain.org -c check_queue_health -t 59
Result:
CHECK_NRPE: Received 0 bytes from daemon. Check the remote server logs for error messages.
nsclient.log
2015-05-28 12:05:38: e:c:\build\nscp\include\socket/connection.hpp:146: Failed to send data: The file handle supplied is not valid

When the timeout is set to 30:
./check_nrpe -H servername.domain.org -c check_queue_health -t 30
Result:
CHECK_NRPE: Socket timeout after 30 seconds.

I am not sure if that helps point us in the right direction but it is a data point
User avatar
tgriep
Madmin
Posts: 9177
Joined: Thu Oct 30, 2014 9:02 am

Re: NRPE Socket Timeout when running check that loads PSSNap

Post by tgriep »

Could you login to the Windows system and open a command prompt, change to this folder c:\Program Files\NSClient++\scripts and run the following command and post the output?

Code: Select all

powershell ./QueueHealth.ps1
Be sure to check out our Knowledgebase for helpful articles and solutions!
ads1923
Posts: 12
Joined: Mon Jun 09, 2014 6:07 pm

Re: NRPE Socket Timeout when running check that loads PSSNap

Post by ads1923 »

Here is the output:

PS C:\Program Files\NSClient++\scripts> powershell.exe .\QueueHealth.ps1
OK: All mail queues within limits.
Locked