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.
You can implement a homegrown solution using either option you described - I would suggest option (2) if you go that route - but doing so is a sub-optimal solution.
What you really want is a Monitoring System that watches the performance counters.
Symantec makes the Altiris suite, which has good Windows support. InterMapper also has Windows support, though you may have to customize it to get what you want.
OpenNMS or Nagios are also options but these are traditionally geared more toward Unix environments.