Powershell.exe processes not closing.
Posted: Sun Nov 09, 2014 7:53 am
Hey,
I'm working on making my check_ms_netstat plugin better, as it seems when connection times out, the powershell.exe process sometimes don't close properly. This has caused CPU related issues on one of my Exchange servers, as it had several powershell.exe and conhost.exe processes, which seemed to hang.
As this Exchange server had 5k+ connections, the plugin timed out (after 120 seconds).
So I solved this by putting get-process in an array before going through all the Netstat connections and then comparing each pid with the array instead of doing a get-process every time. Besides the above, the plugin will only do a get-process if the -P parameter is provided. This shortens the execution of the plugin a lot and it now takes 15 seconds with about 4% cpu on one of my test servers, which has 9k+ connections (SAP).
Did anyone here ran into problems with powershell.exe processes not closing properly? I'm using NSClient++ 0.4.1.101 mostly.
Also made a post about it on the NSclient forum (https://www.nsclient.org/forums/topic/i ... n-timeout/)
Grtz
Willem
I'm working on making my check_ms_netstat plugin better, as it seems when connection times out, the powershell.exe process sometimes don't close properly. This has caused CPU related issues on one of my Exchange servers, as it had several powershell.exe and conhost.exe processes, which seemed to hang.
As this Exchange server had 5k+ connections, the plugin timed out (after 120 seconds).
So I solved this by putting get-process in an array before going through all the Netstat connections and then comparing each pid with the array instead of doing a get-process every time. Besides the above, the plugin will only do a get-process if the -P parameter is provided. This shortens the execution of the plugin a lot and it now takes 15 seconds with about 4% cpu on one of my test servers, which has 9k+ connections (SAP).
Did anyone here ran into problems with powershell.exe processes not closing properly? I'm using NSClient++ 0.4.1.101 mostly.
Also made a post about it on the NSclient forum (https://www.nsclient.org/forums/topic/i ... n-timeout/)
Grtz
Willem