Deploying Custom UI for MP Templates in SCOM 2012 R2

Background

In a much referenced post by Joel Hendrickson, he introduces the concept of Authoring Custom Templates and Writing Custom UI in OpsMgr.  He follows with an excellent and very detailed Custom Template UIPage Code Walkthrough.

Note: As Joel (and the Microsoft documentation) points out, custom templates are currently not supported.
TemplateWarning

Undeterred by the warning and following the guidance in Joel’s post, I was able to quickly reproduce the custom UI as a verification of the steps required as well as a starting point for my own customization needs.

The deployment scenario, however, left me wanting more.  I’m not sure from where my custom template will be run, nor by whom.  It seemed there must be a way to have SCOM deploy this new-found goodness for me.  Luckily, I happened upon a post by Brian Wren where he discusses authoring custom dashboards (including custom widgets) in great detail.  Tucked away nicely in Walkthrough 1 was the missing link: Declaring the Category element which instructs the console that it needs my assembly.

 

Overview
  1. Create a Management Pack Bundle (MPB) containing…
    1. The assembly containing the custom UIPage.
    2. The Management Pack (MP) containing…
      1. The Template declaration,
      2. A Resource declaration for the packaged assembly,
      3. A Category declaration identifying the UI assembly as required for the Operations Console.
  2. Import the Management Pack Bundle into SCOM.
  3. Navigate to Management Pack Templates under Authoring to verify deployment.

 

Detailed Instructions

I used Visual Studio Authoring Extensions (VSAE) to develop my Management Pack Bundle.

  1. In Visual Studio, create a new SCOM 2012 R2 project.
    MP Project
  2. Right-click Solution Explorer and add a class library project to the solution (targeting .Net 4.0).  This project will contain your custom UI.
    UI Project
  3. Add a reference to Microsoft.EnterpriseManagement.UI.Extensibility in the UI project, then following the instructions from Joel’s post, create the EventDetailsPage (derives from UIPage).
    UI Project Expanded
    Sign and build the assembly before proceeding to the next step.
  4. Go to the MP Project and add a project reference to the UI Project.
    MP Project Expanded
  5. Add 3 empty MP fragments (shown above) using the Add | New Item menu.
    1. ManagementPack.mpx – contains the root Name and Description for the project.
      MP Frag
      This fragment is usually created by clicking the Find or Create… link in the project properties.
    2. Resources.mpx – contains the UI assembly reference and category.The Category element’s Target attribute points to the assembly identified below, while the Value attribute indicates that it is required for the Operations Console.
      Resource Frag
      The Assembly element has the following attributes:

      1. ID – the identifier used to reference the assembly (category,template).
      2. QualifiedName – I used this tool to quickly obtain the info required.
      3. FileName – must match the output of your UI project.
      4. HasNullStream – false – indicates that MPB contains the binary
    3. Template.mpx – contains the custom template from Joel’s post.
      TemplateFrag

      The Implementation element in UIPage, identifies the UI assembly and the derived type.UIPage Element
  6. Ensure that the Package To Bundle property is set to true for the UI assembly reference.
    Package To Bundle
    This will instruct VSAE to add the assembly to the MP bundle.

 

Resulting Management Pack Bundle

The following diagram shows the relationship between the UI assembly, the Management Pack (MP), and the containing Management Pack Bundle (MPB).  Add to Operations Manager by importing the MPB.

TemplateTest

More Resources

Download the Sample Solution => TemplateTest Solution Zip File

Note: You will find the complete Management Pack XML document under the SolutionItems folder.

5 thoughts on “Deploying Custom UI for MP Templates in SCOM 2012 R2

  1. Lior

    Thank you vaery very match for the solution.

    one question, I want to use references for different management packs, I had added the reference in the template and in the project but i saw that when i save the UI template in the console its looking for the reference in the unsealed mp and it’s not there.

    how can I resolve this ? its seems that i need to have the reference in the target unsealed mp, but how do I do this ?

  2. Mike Faulkinbury Post author

    Hi Lior,

    I’ve added a diagram in an attempt to better describe the relationships.  The MP project has a project reference (both projects are in the same solution) to the UI project (and that reference has the “package to bundle” property set to true).  When you build the MP project, it will produce an MPB containing the MP and the UI assembly.  Deploy the MPB to Operations Manager.

    Hope that helps,

    Mike

  3. Lior

    Sorry, I think I had not formulated the question correctly, in the template we use references in your case the 3 major ones.

    I want to add this one <Referemce ID=”NTServices” />  witch is the SCOMs default for NT service monitor template.

    I added it to the template and in the project reference with the correct alias.

    After deployment of the MPB I create a new template, but when I save it the scom console its giving me an error saying:

    Now it’s a simple error that in the MP where I try to save the template where is no reference to the MP from the UIPage template.

    When I add the reference to the MP before running the template then it works, how can I make it create the reference in the Manifest of the targeted unsealed MP?

     

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.