Process memory usage trigger

(imported topic written by anthonymap91)

i am trying to write a trigger for a process memory usage:

if (exists wmi) then ( ((string value of selects “WorkingSetSize from win32_process where Name = ‘ABC.exe’” of wmi) as integer) / (1024*1024)) as string & " MB" else “Not available”

I can use the above to know the memory usage, but how do i turn this into a trigger (true or false)

Thanks,

Anthony

(imported comment written by NoahSalzman)

First, if you are on version 8 use the

new Windows Process inspectors

.

The following will return true if WMI exists AND BESClient.exe’s memory is over 1MB.

q: ((string value of selects “WorkingSetSize from win32_process where Name = ‘BESClient.exe’” of wmi) as integer) / 1024

A: 12112

q: (exists wmi) and (((string value of selects “WorkingSetSize from win32_process where Name = ‘BESClient.exe’” of wmi) as integer) / 1024) > 1024

A: True

In version 8 you can ditch WMI for this… it’s simpler syntax and runs much faster.

q: working set size of process whose (name of it is “BESClient.exe”) / 1024

A: 12112

q: (working set size of process whose (name of it is “BESClient.exe”) / 1024) > 1024

A: True