How-To: Import Computer Location Information Into OpsMgr (Part 1-3)

March 16th, 2010 | Posted by blogadmin | View Comments
Posted in How To's

We frequently get questions from customers that want to re-use computer location information that is stored in a CMDB or RFID tracking system with Live Maps. A very understandable question looking at the dynamic datacenter challenges enterprises face today.

Live Maps comes with many features that support dynamic views but it relies on information that is stored in OpsMgr. In this blog series I will explain how you can extend OpsMgr with location information from an external source and how to use that information with Live Maps.

The diagram below shows on overview how we are going to approach this challenge.

I will go through this process in three steps:

  1. Create a management pack that adds a ‘location’ attribute to the Windows Server class
  2. Write a connector that reads asset information from a CSV file and updates OpsMgr
  3. Configure Live Maps to create dynamic location aware maps

In this first article I will describe explain how to create a Management Pack (MP) that extends an existing class with a ‘Location’ attribute.

Create a Management Pack that extends an existing class

The class we are going to extend in this example is the Windows.Server.Computer class. This the base for the Windows 2000/2003 and 2008 server objects in OpsMgr. Because this class is part of a sealed MP, the only way to extend it is to create a new class that inherits from ‘Windows.Server.Computer’. We will create a new MP that contains a class named ‘Windows.Server.Computer.Extended’ and a property called ‘Location’.

Lets start with the base components of the MP.

<ManagementPack ContentReadable="true" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="Y:\Projects\VITALS~1\MANAGE~2\Schema\ManagementPackSchema.xsd">

  <Manifest>

    <Identity>

      <ID>MyExtendedClass</ID>

      <Version>1.0.0.0</Version>

    </Identity>

    <Name>MyExtendedClass</Name>

    <References>

      <Reference Alias="SystemCenter">

        <ID>Microsoft.SystemCenter.Library</ID>

        <Version>6.0.5000.0</Version>

        <PublicKeyToken>31bf3856ad364e35</PublicKeyToken>

      </Reference>

      <Reference Alias="WindowsLibrary">

        <ID>Microsoft.Windows.Library</ID>

        <Version>6.0.5000.0</Version>

        <PublicKeyToken>31bf3856ad364e35</PublicKeyToken>

      </Reference>

    </References>

  </Manifest>

Now lets add the extended class and location property.

<TypeDefinitions>

  <EntityTypes>

    <ClassTypes>

      <ClassType ID="Microsoft.Windows.Server.Computer.Extended" Accessibility="Public" Abstract="false" Base="WindowsLibrary!Microsoft.Windows.Server.Computer" Hosted="false" Singleton="false">

        <Property ID="Location" Type="string" Key="false" CaseSensitive="false" Length="256" MinLength="0"/>

      </ClassType>

    </ClassTypes>

  </EntityTypes>

</TypeDefinitions>

To check the results we also create a folder and a view in the OpsMgr console targeted the extended class.

<Presentation>

  <Views>

    <View ID="View_MyExtendedClass" Accessibility="Public" Enabled="true" Target="Microsoft.Windows.Server.Computer.Extended" TypeID="SystemCenter!Microsoft.SystemCenter.InventoryViewType" Visible="true">

      <Category>Operations</Category>

    </View>

  </Views>

  <Folders>

    <Folder ID="Folder_MyExtendedClass" Accessibility="Public" ParentFolder="SystemCenter!Microsoft.SystemCenter.Monitoring.ViewFolder.Root"/>

  </Folders>

  <FolderItems>

    <FolderItem ElementID="View_MyExtendedClass" Folder="Folder_MyExtendedClass"/>

  </FolderItems>

</Presentation>

Sealing the Management Pack

Because we will use this new class as a target in Live Maps views that are stored in a different MP, we need to seal this MP. At the end of this article you can find a link to the source of the MP which includes both the sealed and unsealed version. If you start creating your own MP based on this blog post you can find instructions on sealing an MP here.

 

Importing the Management Pack

Now that we have created and sealed the MP we can import it into OpsMgr using the Administration pane of the OpsMgr console. After the import a folder named MyExtendedClass should appear in the Monitoring pane containing an inventory view named MyExtendedClass. The view will NOT show any server objects until we have populated the location attribute!

 

In the next article I will focus on creating a connector that reads information from a CSV file and updates the location attribute in OpsMgr.

Downloads: Management Pack

More Information on Live Maps: www.savision.com

Related Articles:

Print Friendly
  • http://blog.savision.com/2010/03/17/how-to-import-computer-location-information-into-opsmgr-part-3-3/ How-To: Import Computer Location Information Into OpsMgr (Part 3-3) | Savision

    [...] How-To: Import Computer Location Information Into OpsMgr (Part 1-3) [...]

blog comments powered by Disqus