Visio Management Pack Designer – “The dependencies for this management pack cannot be located”

This year Microsoft released the Visio Management Pack Designer (VMPD) a tool to design and create SCOM management packs using Visio. Basically it is a plug-in for Visio 2010 SP1 which adds management pack “stencils” and after the design process you are able to check for errors and then compile the “drawing” into a management pack. There is a very good manual on TechNet . Make sure you have the correct Visio edition installed. To design an MP you can use Visio 2010 SP1 Professional but if you want to“compile”  (create) the actual management pack XML you need Visio 2010 SP1 Premium. So working in a team doesn’t really require everyone to install the Premium edition, just the one who compiles the MPs.

I have installed a 3 tier application which I want to monitor using some monitors. To achieve my goal I used the “3-Tier Application Monitoring” template and configured each part of the management pack. It looks like this…

image

After checking the diagram and no errors are found we are able to generate the management pack…

image

There are 3 files generated in my case…

  • ShoppingCartNet.vsd – Visio drawing
  • ShoppingCartNet.xml – Management pack (monitors, discoveries, views, folders, report etc.)
  • ShoppingCartNet.ConnectorRules.xml – Additional management pack (rules, overrides etc.)

image

If you are trying to import the two XML files you will receive an error…

image

Why?

There are rules you have to be aware of concerning management packs…

  • A sealed management pack can reference another sealed management pack
  • An unsealed management pack can reference a sealed management pack
  • An unsealed management pack cannot reference another unsealed management pack
  • A sealed management pack cannot reference an unsealed management pack

Or in other words… only sealed management packs can be referenced.

If you want to know more read this post here from Travis Wright.

In our example ShoppingCartNet.ConnectorRules.xml references the ShoppingCartNet.xml therefore we need to seal ShoppingCartNet.xml and adjust the   PublicKeyToken reference in ShoppingCartNet.ConnectorRules.xml.

Let’s start…

Tools

  • We need the “sn.exe” tool which you can either get if you install Visual Studio or installing the .NET Software Development Kit x86 or x64 edition. Get more information about the tool on MSDN.
  • The actual program we need to seal the management pack is called FastSeal.exe and download it here.

Key file

Now we create a strong name key file which will generate the private and public key…

sn.exe -k scomfaq.snk

Then we extract the public key from the scomfaq.snk file…

sn -p scomfaq.snk scomfaqpublickey.snk

To get the public key in a readable format it is best to write the public key into a text file…

sn -tp scomfaqpublickey.snk > scomfaqpublickeytoken.txt

image

Here the public key token is 26686c19c7becb26.

At this point we have created a the scomfaq.snk key file which we need to seal the management pack and extracted the public key.

MP Sealing

To seal the ShoppingCartNet.xml we use the FastSeal.exe and run this command…

FastSeal.exe ShoppingCartNet.xml /keyfile scomfaq.snk /company “SCOMFAQ”

Use any company name at the /company switch which is suitable for you.

A file called ShoppingCartNet.mp is generated in the same directory…

image

Congratulation, you have now a sealed management pack!

Because we have sealed this management pack with our own key file we need to adjust the “PublicKeyToken” in the referencing management pack ShoppingCartNet.ConnectorRules.xml. If you open this file in Notepad you see the current “PublicKeyToken”…

image

Just copy our public key “26686c19c7becb26” into this file and hit save.

image

Now we are able to import both management packs.

image

Make sure you import the ShoppingCartNet.mp and the modified ShoppingCartNet.ConnectorRules.xml. That’s it Smile!

If you need to make changes edit the ShoppingCartNet.xml file and increase the version number by 1. E.g. from 3.0.0.7 to 3.0.0.8…

image

and seal the management pack again. After sealing the management pack you just can import the *.mp file and the current imported management pack will be updated.

This procedure is not only if you use the Visio Management Pack Designer instead these rules and procedure applies any time you are dealing with unsealed management packs.

Have fun…

1 Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s