NSClient invalid return code: -1073741502


Good morning,

since some months we get Errors by NSClient with such error codes like: “The command (windows_version) returned an invalid return code: -1073741502”

We get it for all of our powershell scripts testing on the server. In this case, the powershell scripts will not finish and gets as zombi processes in the Task Manager. The only way to make NS Client running at this time is to stop NSClient Service and kill all powershell process by "Get-Process | ?{$_.Name -eq “powershell”} | Stop-Process" After making this Workaround, the Problem will be fixed for 12 - 24 hours. Only an Reboot makes this time window greater. Some times also the check_nt (e.g. checking running services) already gives no result.

This Problem already occours on stable Version NSCP- and on Nightly Build Version NSCP-

We make following command execution from Icinga Server, we getting the error immediately not waiting for timeout:

/usr/lib/nagios/plugins/check_nrpe -H server.local.int -a “-w 60 -c 90 -v 45” -c windows_update -n true -t 30 The command (windows_update) returned an invalid return code: -1073741502

  • when we kill all powershell processes, than we get correct result

/usr/lib/nagios/plugins/check_nrpe -H server.local.int -a “-w 60 -c 90 -v 45” -c windows_update -n true -t 30 (OK) Updates Available for installation on Server: 0 - Last Installation: 14.6.2017 (8 days)

Whats the Problem with NSClient and how we can fix it?


Now we could make some test with the servers, on which the problem occours. We often see the problem, when the server has high load and then the powershell script don’t get response from storage or so on. When this happens following script executions wait for finish of the zombi powershell script and also gets Zombie process. During the next 5 - 10 Minutes all check script gets Zombie. When this happens, NSClient still makes the Response -1073741502 for all check scripts.

2017-07-11 05:40:17: error:c:\source\master\include\socket/connection.hpp:139: Socket was unexpectedly closed trying to send data (possibly check your timeout settings) 2017-07-11 05:40:21: error:c:\source\master\modules\CheckSystem\pdh_thread.cpp:377: Failed to get Mutex for: cpu 2017-07-11 05:40:22: error:c:\source\master\modules\CheckSystem\pdh_thread.cpp:392: Failed to get Mutex for: metrics 2017-07-11 05:40:27: error:c:\source\master\include\scheduler\simple_scheduler.cpp:189: Ran scheduled item 2 9 seconds to late from thread 102