Antony Hawkins

Count of Windows Processes

Recommended Posts

I wrote this DataSource for a customer with a specific requirement, namely, they have a particular application that should spawn and maintain a specific number of processes on Windows machines.

Operation: The DataSource finds all processes on the Windows machine and groups and counts based on name - e.g. if there are processes powershell, powershell#1, powershell#2, then the powershell instance will be added and will show a count of 3.

Out of the box this DataSource will create instances for *all* processes as reported from the Win32_PerfRawData_PerfProc_Process WMI class, except the "Idle" process and the "_Total" metrics.

This behaviour is unlikely to be of great benefit; the main use case will involve editing the filters (and cloning the DS as appropriate) such that it only brings back processes you care about (and not, for example, the dozens of svchost processes that will be present on every Windows machine).

Also returned are thread count, file handle count, and working set metrics, each being the sum of the per-process metrics. This is possible as these are instantaneous values.

Note that unlike the per-process DataSource, CPU metrics cannot be returned. This is because these metrics are returned by WMI as incremental counters and the appearance and disappearance of individual processes between polls would render any sum meaningless. It is however possible to see combined CPU metrics for multiple processes via manipulation of the WinProcessStats- DataSource (clone and filter for the processes you need) and smart graphs with a sum aggregation.

v1.0.0 Exchange Locator ID: XHT4MD

Example of instances found:

5bd73ead7ecc1_ScreenShot2018-10-29at15_37_14.thumb.png.cadd5cc6e477cf5e4df71873cddfba15.png

Overview graphs:

5bd73ed561e70_ScreenShot2018-10-29at16_48_25.thumb.png.e9514f9347b3f25cedd6da2cde5e831a.png

Per-instance graphs:

5bd73eec74536_ScreenShot2018-10-29at16_49_17.thumb.png.d531874e888b3699ca1ab54efb3ca817.png

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now