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 writes 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 don't use it for much, but 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 and collection rules with the console is somewhat cryptic and generally far too painful so use an XML editor or better 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.
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"
- 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:
- 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 items to the MP.
Let's start by check 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.
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.
So 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. Again, Hyper-V 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.