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:
- 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
- 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
- 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
- Install the SCOM console on the system you will be doing the authoring on
- 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:
- 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
- Run the installer and extract the sealed MPs to a local path like c:\authoring\dependencies
- Launch the Authoring Console
- Select File->New.. Empty Management Pack
- Give your MP a name, I used BridgeWays.Windows.HyperV
- Give your new MP a Display Name, such as "BridgeWays Windows Hyper-V"
You now have an unsaved shell Management Pack that does nothing. So let's set it up to extend the core Hyper-V MP:
- Click Tools->Options...
- Go to the references tab and add in the System Center directory and the directory where you put the Hyper-V MP.
- Next, go File->Management Pack Properties and go to the References tab
- Click Add Reference
- Select the MPs that you want to extend and use, I selected the Hyper-V 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'.
- In the Authoring Console, click the Presentation tab.
- Right-Click the Microsoft.Windows.HyperV.RootFolder and select New->Folder
- Give your new folder an object name such as BridgeWays.Windows.HyperV.Performance and a display name like Performance
- Click the Folder tab and make sure the selected folder is Microsoft.Windows.HyperV.RootFolder
- Click OK
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.
- Right click on the new folder (BridgeWays.Windows.HyperV.Root in my case) and select New->State View
- Give it a new ID postfix, such as ServerRole.State
- Give it a Display name, such as "Server Role State"
- Click the ellipses by Target and select the target we want to show in the state view, in this case Microsoft.Windows.HyperV.ServerRole
- 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.