Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

  1. create task that is triggered by event from source Microsoft-Windows-Diagnosis-PLA
  2. 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.

share|improve this question
It seems that logman alert runs the task from Task Scheduler list according to its name (ID). So now I need command line for creating the task, that will run email sender or something like that (or push to Azure MSMQ). And also the utility (repeated task) to send the messages) – Tomas Mirezko Oct 7 '11 at 19:09
logman create alert ContextSwitchAlert -th "\System\Context Switches/sec>100" -el -tn "ContextSwitchesTask" – Tomas Mirezko Oct 7 '11 at 19:10

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.

share|improve this answer
I know that full blown monitoring system would be more suited, but that would be more complicated to configure for me than just a few command for these alerts by a WinServer expert. I may be upgrading to monitoring system later if really neccessary. Also there is a factor of Windows Azure environment and its accessibility to these monitoring systems. But thanks for the tip. – Tomas Mirezko Oct 7 '11 at 18:54
Configuring a monitoring system now, when you have a handful of machines is much easier than when you have a hundred machines. Putting it off is a common thing to do and it almost always means more work later. Also don't be misled into thinking that it's "hard" to monitor the cloud: If you can access it to use/administer it you can access it to monitor it. – voretaq7 Oct 7 '11 at 19:08
Windows Azure monitoring is still very young and I can't find solutions that I could afford/use. I am able to run bat/cmd/exe with admin privileges and I can run sw that is not installed just copied (done with xcopy). (I have single server instance for now) – Tomas Mirezko Oct 7 '11 at 19:16

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.