Tip: Four ways to target notifications to a more granular level OpsMgr and Essentials 2007
Targeting notifications to at a granular level in Operations Manager and Essentials 2007 can be challenging, especially when you must filter down to a single rule or monitor. Doing this through the console GUI is seldom intuitive (especially for less experienced users), and sometimes not possible at all. I wanted to discuss four different methods you can use to refine your notification targeting to the most granular level possible in a variety of situations.
1. Powershell - Using the Future Occurrences of an Alert Powershell script Brian McDermott put together, you can use a task that launches a Powershell script to create a new Notification Subscription that targets all future occurrences of the alert you specify. This solution requires some advance configuration. Be sure to follow the configuration instructions in Brians blog post carefully. And of course it also requires that you generate at least one occurrence of an alert if you want to use the Powershell task to create the subscription.
2. Combinations of Resolution State, Group and Class - As you will see, there’s a lot of flexibility in this method, although it takes some work. As Jeremy Pavleck mentions, you have 254 possible resolution states that can be used to in a Notification Subscription to target a notification subscription. However, you cannot set a custom resolution state in the UI, so running a Powershell script on a timed basis using a rule or scheduled task can be used to set the resolution state to the desired value and thus, trigger a notification subscription. See Jeremy’s walkthrough on how to make this happen.
http://pavleck.net/2008/07/03/using-resolution-states-to-fine-tune-alert-notifications/
As mentioned by one of Jeremy’s readers, you can also tweak the Powershell to only flip the resolution states for alerts containing a particular keyword.
Kicking it up another notch!
Let’s take this even one step further. We can leverage the filtering options in notification subscriptions in Operations Manager and Essentials 2007 to stretch this even further. Since we can define a more granular notification subscription using groups and classes, as well as resolution states, we can specify object classes and groups as filtering options as well. This can essentially allow us to use a resolution state multiple times, thus extending Jeremy’s solution exponentially further than the 254 available resolution states.
WARNING: Be careful not to run too many Powershell instances too often. You’re imposing load on the Root Management Server with every run, so you want to be sensitive to that. And if you have a large number of alerts, it can take a few seconds to run.
NOTE: This option is not so easy in Essentials 2007, as there is no Command Shell. However, it is not completely impossible, as you can use Powershell in Essentials to attach to the management group through the SDK. See our article on a Command Shell for Essentials 2007 at the URL below.
http://www.systemcenterforum.org/sce-2007-command-shell/?
3. Using Distributed Applications and / or MP Templates - Every set of monitors created with one of the available management pack templates creates a new object class that can be targeted for notification. The same is true of a distributed application. You’ll see an object class for every distributed application you create.
Long story short. If you can establish the monitors you need using either of the above, you can easily target your notification to the class created as a result.
4. Create a Custom Object Class - Using the Create Attribute Wizard, you can create a registry or WMI-based object discovery for your own custom object class, specializing the existing class of your choice. So, if you needed to target a notification to a particular event or condition even on a single server, we could use a registry-based discovery to target a characteristic unique to that machine, be it a Windows service (in HKLM\System\CurrentControlSet\Services) or even the server name, which is also stored in the registry.
Just as in the previous example, the object class is then available for filtering the notification to rules and monitors targeting the class you create.
I’ll stop here, but hopefully these have given you some fresh ideas for targeting notifications in your environment.?