sensu-plugins / sensu-plugins-windows

Sensu Windows Plugins

Home Page:http://sensu-plugins.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

powershell.exe Terminated

stevebanik-ndsc opened this issue · comments

Resource Monitor is showing Terminated powershell.exe processes each time Sensu runs the check. Is there a way to close powershell.exe more gracefully? I'm also curious if CPU usage can be decreased with these checks, as they tend to spike each time powershell.exe is invoked.

might be related? #39 can you validate if you are using poweshell 2?

Also regarding the cpu spikes. how does your command look to initiate the powershell check? It's best to start powershell with the following flags to reduce the cpu usage: Powershell.exe -NonInteractive -NoProfile -ExecutionPolicy Bypass -NoLogo

@majormoses PSVersion = 4.0

@simonsteur I've included Powershell.exe -NonInteractive -NoProfile -ExecutionPolicy Bypass -NoLogo in the .json file.

@stevebanik-ndsc Sorry for my confusion but do you mean you already had that included or that you added it now. Incase of the second, do you see any difference?

Also to pick up on that powershell is listed as terminated in resource monitor. That is expected behavior and has nothing to do with a graceful exit of an application. The resource monitor shows terminated processes for a short while, their cpu usage, etc. This is the case for all applications, regardless of how they exit.

Since your sensu checks will run every x amount of time, powershell.exe will probably have a permanent place among the terminated processes. This is nothing to be concerned about and completely normal.

It sounds like this is intended behavior, is there anything to actually be done here? Maybe something in the readme would help?

@simonsteur I already had that included. What you've described regarding "terminated" in Resource Monitor makes sense. Thanks for that info.

closing this out then, please feel free to message back if you feel this should remain open.