I'm attempting to kick off a piece of code I wrote when the CPU Usage reaches a specifiable percentage.
Can anyone direct me on how to accomplish this? Thus far I've tried using the task scheduler but to no avail.
I am using Windows Server 2008 R2.
|
I'm attempting to kick off a piece of code I wrote when the CPU Usage reaches a specifiable percentage. Can anyone direct me on how to accomplish this? Thus far I've tried using the task scheduler but to no avail. I am using Windows Server 2008 R2. |
|||
|
|
|
The best way to do this is to use the Windows Performance monitor Or WMI(I forgot what it stands for). Using Perfmon, you can have it create a custom event when CPU usage gets to 80%, then make task scheduler run your program when it sees your custom event. This is possible with WMI, but I've never used it. It's possibly a hair more efficient. |
|||
|
|