I thought I was getting the number of running windows processes with the following clause:
q: number of running applications whose (name of it starts with “notepad”)
A: 1
but it’s only returning “1” or “0”. If I open three instances of notepad, it still returns “1”. How can I query the number of running processes across all users, instead of the number of applications?
My goal here, is to retrieve the number of concurrent BESConsole processes on our Citrix servers, so I can see how our admins are using it (when, how many at once, etc)
Unfortunately, the “running application” inspector only counts each application once… We have an open request for a “process” inspector that will return the data that you are looking for, but it always falls off the bottom of the release list due to time constraints…
Perhaps you can used the “logged on user” inspector instead?
I cringe everytime I use WMI but it is an option while we wait for process inspectors. As a property in an analysis you can have it evaluate less frequent and target only those nodes so the impact can be minimized.
The query below ran for ~187ms for a terminal server that had ~450 results for selects “Name of Win32_Process”
number of (selects “Name from Win32_Process where Name = ‘BESConsole.exe’” of wmi)
Actually there is a clever way to do this with our ‘application usage’ inspector.
Use the ‘Edit Computer Settings…’ dialog to enable application tracking on the client (if it is not already enabled) by setting the following client setting:
_BESClient_UsageManager_EnableAppUsage = 1
Create a property with the following relevance:
maxima of items 1 of application usages “BESConsole.exe”
The result will tell you the maximum number of concurrent BES Consoles the client has seen running since the last client registration. Here’s the precise behavior:
Data from the application usage inspectors is periodically purged from the client. The client maintains a log of application start and end times. Whenever it reports, it adds a marker in the log to identify the report number being sent. Whenever it registers, it gets back confirmation of the highest report number received by the server. It then purges this log up to the matching mark.
Strawgate,
That’s almost perfect. All I need is the name of all running processes. If I remove the “then” statement will that remove the pathname from the analysis?
In case you ever compare the values to the task manager in Windows, the names can be different so the following will actually give you the results in the form the task manager presents