Page 2 of 3
Re: NRPE Socket Timeout when running check that loads PSSNap
Posted: Wed May 20, 2015 12:33 pm
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 -
Re: NRPE Socket Timeout when running check that loads PSSNap
Posted: Fri May 22, 2015 1:21 pm
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.
Re: NRPE Socket Timeout when running check that loads PSSNap
Posted: Fri May 22, 2015 1:45 pm
by ssax
At the bottom of your nsclient.ini
Remove:
Code: Select all
allowed hostes = 10.10.10.10, 10.10.10.20
Change:
To:
Restart your nsclient service and try it again.
Re: NRPE Socket Timeout when running check that loads PSSNap
Posted: Fri May 22, 2015 3:07 pm
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.
Re: NRPE Socket Timeout when running check that loads PSSNap
Posted: Sun May 24, 2015 8:31 pm
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.
Re: NRPE Socket Timeout when running check that loads PSSNap
Posted: Tue May 26, 2015 2:08 pm
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.
Re: NRPE Socket Timeout when running check that loads PSSNap
Posted: Tue May 26, 2015 2:38 pm
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.
Re: NRPE Socket Timeout when running check that loads PSSNap
Posted: Thu May 28, 2015 2:13 pm
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
Re: NRPE Socket Timeout when running check that loads PSSNap
Posted: Thu May 28, 2015 4:00 pm
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?
Re: NRPE Socket Timeout when running check that loads PSSNap
Posted: Thu May 28, 2015 4:10 pm
by ads1923
Here is the output:
PS C:\Program Files\NSClient++\scripts> powershell.exe .\QueueHealth.ps1
OK: All mail queues within limits.