Performance counter alert not working
I want to monitor for example CPU usage on a server and run a script which will figure out the most demanding processes and logs it into file. I planned to use Performance counter alert which can be defined in Perfmon / Data collector sets / User Defined. But somehow it does not seem to do anything. I set "alert action" to log an entry in application event log and alert task to run my script but none of this happens when the conditions are met...
You can clearly see that exactly this value much exceeds the set threshold but still no alert is triggered.
If somebody knows how to set it up, please let me know.
Solution 1:
So after a lot more googling (I hoped somebody here will do it for me ;) I figured it out!
Task field
The Run this task when an alert is triggered:
field is not a path to a program, but name of a task which needs to be defined in Task Scheduler
! I would expect this field to be a combobox with selection of all tasks, but it is not, so it is pretty unclear what it means. So I defined a simple task in Task scheduler (taskschd.msc
) with action "start a program"
and now it works!
Not "Application" log
Also about the event log entry: The Log an entry in the application event log
check box is somewhat misnamed. It indeed logs, but hides it deep into Applications and Services Logs\Microsoft\Windows\Diagnosis-PLA\Operational
. I was looking for a message in Application
event log as the settings window says.
Further reading
- Taylor Brown, Microsoft, 2012-09-25, Leveraging Event Log Messages and Performance Counter Alerts To Automate Hyper-V (Archived here.)