A few questions of interest - Question 8
Published Jan 21 2019 11:29 PM 303 Views
Microsoft

First published on MSDN on Jan 07, 2008

1.       Is it possible to create notifications on a rule by rule basis?  If so, how?  If not, why not?

 

Yes, this is possible but not as you might expect.  There is no exact method for configuring notifications on specific rules/monitors and not others in the GUI but we do expose this ability through code.  There are a few options.

 

Using C#
Jakub’s blog site is full of good information – including info on this topic.  Take a look at the following link to see a very good example of configuring notifications, rule by rule, using C#.

 

http://blogs.msdn.com/jakuboleksy/archive/2007/01/18/notification-subscriptions.aspx

 

Using Powershell
The C# option doesn’t work for everyone so a more simple method might be to use Powershell.  The following blog post describes the Powershell option and is basically a powershell implementation of Jakub’s C# code.

 

http://code4ward.net/cs2/blogs/code4ward/archive/2007/09/19/set-notificationforalert.aspx

 

GUI options
If a GUI option is preferred it should be possible to configure alerts and rules so that they are subject to notification while others aren’t.  One possible solution would be to reconfigure the alert priority (via override) for all alerts that should have notifications sent while keeping the ones where no notification is needed at a different priority.   The default alert priority may not be consistent rule to rule so there would be some manual work to set all of this up.  Using the C# or Powershell option would be simpler.  If this GUI method is preferred you need to reconfigure priority (or another option as you prefer) in at least two places – the subscription and the rule/monitor.

 

Configuring the subscription
In the properties of the subscription we have the option to set a priority.  The default is to notify on all High and Medium priority alerts.

 

 



 

If we look at the properties of the rule/monitor in question we will see what priority will be used by default when the alert is generated.

 

 

 

 



 

 

We are able to override this default priority to be whatever we like as shown.

 

Version history
Last update:
‎Apr 07 2020 09:18 AM
Updated by: