Orphaned Powershell Processes from NSClient++
Posted: Thu May 31, 2018 4:20 am
I am using NSClient 0.5.0.62
I run several powershell scripts that scan logfiles that sometimes take a long time to return - breaching the 60 second time limit
For some reason NSClient occasionally fails to properly terminate these powershell processes, eventually leading to them building up over time and eating all of the memory
There are also a number of errors in the nsclient log-
2018-05-22 16:03:19: error:c:\source\master\include\socket/connection.hpp:120: Socket was unexpectedly closed trying to send data (possibly check your timeout settings)
2018-05-22 22:07:08: error:c:\source\master\include\socket/connection.hpp:120: Socket was unexpectedly closed trying to send data (possibly check your timeout settings)
2018-05-22 23:09:31: error:c:\source\master\include\socket/connection.hpp:120: Socket was unexpectedly closed trying to send data (possibly check your timeout settings)
2018-05-23 02:06:52: error:c:\source\master\include\socket/connection.hpp:120: Socket was unexpectedly closed trying to send data (possibly check your timeout settings)
Is there a way I can do this where the powershell scripts dont get orphaned?
I use the following registry entry to fire off the command-
I run several powershell scripts that scan logfiles that sometimes take a long time to return - breaching the 60 second time limit
For some reason NSClient occasionally fails to properly terminate these powershell processes, eventually leading to them building up over time and eating all of the memory
There are also a number of errors in the nsclient log-
2018-05-22 16:03:19: error:c:\source\master\include\socket/connection.hpp:120: Socket was unexpectedly closed trying to send data (possibly check your timeout settings)
2018-05-22 22:07:08: error:c:\source\master\include\socket/connection.hpp:120: Socket was unexpectedly closed trying to send data (possibly check your timeout settings)
2018-05-22 23:09:31: error:c:\source\master\include\socket/connection.hpp:120: Socket was unexpectedly closed trying to send data (possibly check your timeout settings)
2018-05-23 02:06:52: error:c:\source\master\include\socket/connection.hpp:120: Socket was unexpectedly closed trying to send data (possibly check your timeout settings)
Is there a way I can do this where the powershell scripts dont get orphaned?
I use the following registry entry to fire off the command-
Code: Select all
cmd /c echo scripts\check_logfile_date.ps1 $ARGS$; exit $LastExitCode | powershell.exe -ExecutionPolicy bypass -command -