I have a Windows Server 2008 SP2 without a graphical user interface (Windows Azure).
I need to setup an alert for performance counters that reaches some threshold and then run some command (send an alert, email, something).
So far I did find a way to create an alert with logman
logman create alert ContextSwitchAlert -th "\System\Context Switches/sec>100" -el
logman start ContextSwitchAlert
Now I need to assign some task to it. I've found two options, but I was unable to execute neither of them, because of my experience.
- create task that is triggered by event from source Microsoft-Windows-Diagnosis-PLA
- create task that is executed by alert itself (don't know if this should be exe file or could be bat/cmd)
I don't work much with servers, but this is the single thing I need to do on Windows Azure to get the alerts.
Question: What is the best way to do this? Option 1, 2 or other?
Or is there a way to handle the alert/event from logman in the WebRole class?
I am open to suggestions. Thanks.