Xplat Xperts

  • Home
  • Archives
  • Subscribe

Writing Management Packs for SCOM: Adding your own Monitors

In the first part of this series we got our toolset setup so that we can write our own MP, created a root folder and added a state view to duplicate the Hyper-V Server Role state view. 

Now it's time to start adding our own extensions to the base Hyper-V MP, keep in mind that what I'm doing here will work with any management pack, including the BridgeWays MPs where we may be exposing data but only consuming it through rules and you want to add a monitor.

So open up the Authoring Console and goto the Health Model frame.  You'll see that we have the option to add Discoveries (we don't need these right now because the base Hyper-V MP is doing this for us), Monitors, Rules, Service Levels, etc.

Hyper-V Monitors Frame

Let's create a new monitor:

  1. Right-Click the view frame and select New->Windows Performance->Static Threshold->Average Threshold to create a new monitor that will take the average of a series of polls and determine Health/Error state from that average value
  2. Provide a new name, I'm going to build an alert for the number of Virtual Machines being reported as in a critical state, so my name is VMsCritical
  3. Give the monitor a display name "Virtual Machines are Critical"
  4. Specify the target by clicking the ellipses, selecting list and finding hyper.  I set the target to Microsoft.Windows.HyperV.ServerRole so that the monitor will run against any Hyper-V Server
  5. Set the Parent Monitor to be System.Health.PerformanceState.  This is because I feel VMs in a critical state is a resource issue causing bad performance, it's not necessarily an Availability issue because the VMs are running.
  6. Click Next
  7. Now, we set the object we're going to monitor.  You can either hit the Select button and search for the appropriate perfmon counter through the dialog that pops up or enter the data directly.  For this counter it is:  Object = Hyper-V Virtual Machine Health Summary, Counter = Health Critical, Instance is blank.
  8. Set an appropriate interval for the monitor, 5 minutes is the lowest you should go.
  9. Click Next
  10. Set our threshold, I use 1 because I want to know if even a single VM is critical
  11. Set our number of samples, I use 2 if a VM goes critical and then clears the next poll... I'm fine with that, the problem was a blip.
  12. Click finish and we're almost done.

We've created the base monitor, now we just need to do a little tweaking to make it be everything we want it to be.  To finish things off, select the monitor and click properties.

Hyper-V VMs Critical 

  1. Goto to the Health Tab and change the Over Threshold Health state to be Critical, I do this because I view VMS being critical as a Critical alarm.
  2. Click on the Alerting tab and select Generate alerts for this monitor, you can also tweak the priority and severity which helps you sort alerts in custom alert views where you may only want to see Critical alerts shown.
  3. Click on the Options tab and change Accessibility to "Public" so that you can make future MPs that extend this MP and people can add Diagnostic and Recovery tasks to the monitor without having to be part of this MP directly.
  4. Click on Product Knowledge, Edit and this will launch Word, if you have it and visual studio installed, so you can create a KB article. 
  5. Goto the word document that launched and add some knowledge base information about the monitor, why it would fire, and how to fix it.

Now that we've done that, save your MP.  Import the new version into SCOM and see how the monitor shows up under the Performance

Hyper-V Health Model

Repeat this process to add any additional monitors you may wish to have.

Part 1: Getting Started with writing a more robust Hyper-V MP
Part 2: Adding your own Monitors
Part 3: Adding Rules and Performance Views
Part 4: Adding Dashboards

Posted on February 12, 2010 at 04:02 PM in Operations Manager, Technology | Permalink | Comments (0) | TrackBack (0)

Reblog (0) | Digg This | Save to del.icio.us | Tweet This!

Writing Management Packs for SCOM: A more robust Hyper-V MP

Have you ever been looking at a management pack and wishing it was collecting just a little more information for you?  You're not the only one, there are quite a few people who write MPs from scratch to support applications they are running, but there are more who are still a little leery of going down the path of MP Authoring.  In the next series of posts I'm going to walk through extending the base Hyper-V management pack so that it provides more information around how healthy the servers really are. 

Tools of the trade:

  1. System Center Operations Manager 2007 R2 Authoring Console: I'm going to focus on writing the MP using the Authroing console as opposed ot raw XML, it's a good tool to use when you want to build out quick Windows based monitors, validate the XML schema, and see all the views you have created. http://www.microsoft.com/downloads/details.aspx?FamilyID=9104af8b-ff87-45a1-81cd-b73e6f6b51f0&displaylang=en
  2. XML editor: trying to make things like Dashboards. Performance views and a few other components still require that you write raw XML, so you'll need an editor which can be nothing more than notepad if you wish, I use Visual Studio
  3. Authoring Guide: keep it handy so you can make reference to it when some of the XML layout makes you want to scream. http://technet.microsoft.com/en-us/opsmgr/bb498235.aspx
  4. Install the SCOM console on the system you will be doing the authoring on
  5. To make writting KB articles a bit easier, install Visual Studio and Word on the system you will be using to author the MPs.

Now let's run through the steps to get things setup:

  1. Get a copy of the MP you want to extend, you do this by downloading the manual install package as opposed to installing the MP via the SCOM catalog.  For Hyper-V you can get the installer at: http://www.microsoft.com/DownLoads/details.aspx?familyid=502E7A26-2FEA-4052-89FD-8F75142DE4F2&displaylang=en
  2. Run the installer and extract the sealed MPs to a local path like c:\authoring\dependencies
  3. Launch the Authoring Console
  4. Select File->New.. Empty Management Pack
  5. Give your MP a name, I used BridgeWays.Windows.HyperV
  6. Give your new MP a Display Name, such as "BridgeWays Windows Hyper-V"
  7. Create

You now have an unsaved shell Management Pack that does nothing.  So let's set it up to extend the core Hyper-V MP:

  1. Click Tools->Options...
  2. Go to the references tab and add in the System Center directory and the directory where you put the Hyper-V MP.

    References
  3. Next, go File->Management Pack Properties and go to the References tab
  4. Click Add Reference
  5. Select the MPs that you want to extend and use, I selected the Hyper-V MPs
    MPs

Now we're ready to start adding our rules and monitors.

Let's start by checking to see if we can extend the MP directly, ie add our own folders and views to the Hyper-V folder in the SCOM Monitoring hierarchy.  This is determined by whether or not the root folder is flagged as 'internal' or 'public'.

  1. In the Authoring Console, click the Presentation tab.
  2. Right-Click the Microsoft.Windows.HyperV.RootFolder and select New->Folder
  3. Give your new folder an object name such as BridgeWays.Windows.HyperV.Performance and a display name like Performance
  4. Click the Folder tab and make sure the selected folder is Microsoft.Windows.HyperV.RootFolder
  5. Click OK

RootFolder

No luck with the Hyper-V MP, the root folder is internal and it doesn't have any other folders so in this case we'll have to build out a parallel MP that has our new information in it.  For Hyper-V it's not a big deal since there are only the 3 state views, for an MP like SQL Server, luck is on our side the root folder is public so we can extend that MP directly.

Another way to do this is to use the MP Viewer tool that you can get from here http://blogs.msdn.com/boris_yanushpolsky/archive/2008/01/31/mpviewer-1-3.aspx 

To create the new folder, simply follow the previous steps, but give your folder a more precise name like "BridgeWays Windows Hyper-V" and set the parent folder to be Microsoft.SystemCenter.Monitoring.ViewFolder.Root .  Now we have a new root folder for any views we want to create.

Now let's create a duplicate state view within our new folder.  This state view will simply duplicate the same information as the Hyper-V MP shows in the Server Role View.  I'm doing this because I know I'll be adding a number of monitors as well as performance views and I don't want to have to switch from one folder to another when I'm watching the environment.  The Hyper-V MP only has 3 state views so it's not a big deal to duplicate them.

  1. Right click on the new folder (BridgeWays.Windows.HyperV.Root in my case) and select New->State View
  2. Give it a new ID postfix, such as ServerRole.State
  3. Give it a Display name, such as "Server Role State"
  4. Click the ellipses by Target and select the target we want to show in the state view, in this case Microsoft.Windows.HyperV.ServerRole
  5. Click Finish

That's it, we've just duplicated the Server Role View from the Hyper-V MP to our new custom MP.  The beauty of this is we don't have to redo the discoveries or anything because the data is already being populated by the core MP.

For the next post, we'll look at adding our own monitors to the discovered servers.

Part 1: Getting Started with writing a more robust Hyper-V MP
Part 2: Adding your own Monitors
Part 3: Adding Rules and Performance Views
Part 4: Adding Dashboards

Posted on February 04, 2010 at 03:43 PM in Operations Manager, Technology | Permalink | Comments (0) | TrackBack (0)

Reblog (0) | Digg This | Save to del.icio.us | Tweet This!

SCOM - BridgeWays Management Pack Videos: VMware ESX, JBoss AS and Oracle DB

We've recently started to build out some nice overview videos of the BridgeWays management packs, you can find the first three on YouTube and higher resolution versions will be available at www.bridgeways.ca soon.

Introduction to monitoring Oracle Databases


Introduction to monitoring VMware ESX 3.x and vSphere

Introduction to monitoring JBoss Application Servers

Posted on December 22, 2009 at 07:52 PM in BridgeWays, Operations Manager, Technology | Permalink | Comments (1) | TrackBack (0)

Reblog (0) | Digg This | Save to del.icio.us | Tweet This!

Subscribe

  • Subscribe to this blog's feed

Sites We Like

  • System Center Central
  • Bridgeways Management Packs

Categories

  • BridgeWays
  • Debugging
  • Hyper-V
  • Management Packs
  • Operations Manager
  • SCOM
  • Technology