How to insert Knowledge into a SCOM Management Pack

At most companies I consult to, very few (almost none) of them ever provide Product Knowledge to their custom MP’s. Whilst it might be a brief time saver to ignore this step when you’re creating a new Management Pack or Rule or Monitor it really does help later on when it comes time to remember what you were trying to achieve when you created whatever it was you created. It’s the same with scripting…you’ll never regret providing good comments or descriptions and you should treat SCOM Product Knowledge no differently.

Truth is though, almost every time I am at a clients site and try to add Product Knowledge I get hit with this wonderful message.

Visual Studio Tools for Office Runtime is not installed.

Visual Studio Runtime Not Installed

 

 

 

 

 

 

So in almost all cases if I need to add Product Knowledge then I’ll do it XML and I’ll show you how to do it. First of all you’ll need to
export the Management Pack out to an XML file. You can do that from the Console if it’s unsealed or use Windows PowerShell.

In PowerShell you’d do something like this:

Get-ScomManagementPack | ? {$_.Name -eq “Your.Management.Pack”} | Export-ManagementPack -Path C:\Temp

But for the purposes of this demonstration, I’m going to create a brand new management pack just so it’s less cluttered and will
make it a little easier to follow.

So in the SCOM Console we’ll go to Administration, Management Packs and in the Actions Pane click “Create Management Pack”.

I’ll fill the Name and Description and click “Next”.

Knowledge - Create New MP

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

And in this next window I have that same problem…if I click “Edit” I can’t add any knowledge.

Knowledge - Create New MP No Knowledge

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

That’s ok, we’ll click “Create”.

Once our MP is in the console we’ll select it and export it or use Windows PowerShell.

Get-SCOMManagementPack | ? {$_.DisplayName -eq “Culham Knowledge MP”} | Export-SCOMManagementPack -Path C:\Temp

Now that we have our exported MP, let’s open it up with Notepad.

First up, here is the entire MP in all its glory.

Knowledge - All default XML

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Pretty basic with only a reference to the System.Center.Library MP and some presentation stuff. I will point out that there is also a folder that will have been created in the Monitoring section of the console. Go on, click it and take a look. In my case I called my MP “Culham Knowledge MP” so SCOM has added a folder to the console. Now if this is going to be an MP that has views for Alerts and Dashboards and so forth then you will want to keep this folder. If its going to be for overrides or something that you’ll never have a view for you can delete the folder.

Simply right click and delete it.

Knowledge - Folder

 

 

 

Or you can delete this directly from the XML. Delete everything within and including the <Presentation></Presentation> tags.

Knowledge - Folder Delete 1

 

 

 

 

 

 

And this…

Knowledge - Folder Delete 2

 

 

 

 

Either way after we’re done removing those unnecessary parts, we’re left with this much smaller file.

Knowledge - Folder Deleted all

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

So onto the Knowledge Stuff. Knowledge in SCOM Management Packs is presented in the MAML format which is something I am not going to dive into, there’s plenty of places on the Internet that describe MAML in great detail I’ll just provide you with the basic structure of what you need in order to get Knowledge into your MP’s.

Here’s the basic structure of what I would use in most situations.

<KnowledgeArticles>
<KnowledgeArticle ElementID=”SOMETHING GOES HERE” Visible=”true”>
<MamlContent>
<maml:section xmlns:maml=”http://schemas.microsoft.com/maml/2004/10″>
<maml:title>TITLE OF THE TEXT IN OTHER WORDS…A HEADING!</maml:title>
<maml:para>Basic Text Goes Here.</maml:para>
</maml:section>
</MamlContent>
</KnowledgeArticle>
</KnowledgeArticles>

 

Between the <KnowledgeArticles></KnowledgeArticles> tags, we provide our Knowledge Article. This knowledge article must be attached to something and it’s the Element ID of the object we’re looking for. So in my case if I’m providing knowledge to the
Management Pack itself, the ElementID of my Management Pack is Culham.Knowledge.MP.

Knowledge - Element ID

 

 

 

 

 

So we’ll need to change “SOMETHING GOES HERE” to “Culham.Knowledge.MP”.

Now we’ll want to pump some text into that Knowledge Window for the MP.

We can use the TITLE and PARA Properties to do just that.

<maml:title>TITLE OF THE TEXT IN OTHER WORDS…A HEADING!</maml:title>
<maml:para>Basic Text Goes Here.</maml:para>

 

Let’s see how it all looks when put together.

<KnowledgeArticles>
<KnowledgeArticle ElementID=”Culham.Knowledge.MP” Visible=”true”>
<MamlContent>
<maml:section xmlns:maml=”http://schemas.microsoft.com/maml/2004/10″>
<maml:title>TITLE OF THE TEXT IN OTHER WORDS…A HEADING!</maml:title>
<maml:para>Basic Text Goes Here.</maml:para>
</maml:section>
</MamlContent>
</KnowledgeArticle>
</KnowledgeArticles>

 

We’ll paste this into our MP right after the </DisplayStrings> tag

Knowledge after Display Strings

 

 

 

 

 

 

 

Now we’ll import it back into SCOM and open up the Properties of our Management Pack.

 

Knowledge - Imported

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

How good is that? At least we have something now. We can even modify this further to add in more lines of text if we like…
I’ll change that MP to this…

<KnowledgeArticles>
<KnowledgeArticle ElementID=”Culham.Knowledge.MP” Visible=”true”>
<MamlContent>
<maml:section xmlns:maml=”http://schemas.microsoft.com/maml/2004/10″>
<maml:title>Culham Knowledge MP</maml:title>
<maml:para>This is the first line of text.</maml:para>
<maml:para>Here is a new line.</maml:para>
<maml:para>Here is line 3.</maml:para>
<maml:para>I can even use the Copyright symbol © www.culham.net</maml:para>
</maml:section>
</MamlContent>
</KnowledgeArticle>
</KnowledgeArticles>

 

And here’s how that looks once imported.

Knowledge - Imported 2

 

 

 

 

 

 

 

 

 

 

 

Let’s add something else…Bullet Points.

<KnowledgeArticles>
<KnowledgeArticle ElementID=”Culham.Knowledge.MP” Visible=”true”>
<MamlContent>
<maml:section xmlns:maml=”http://schemas.microsoft.com/maml/2004/10″>
<maml:title>Culham Knowledge MP</maml:title>
<maml:para>This is the first line of text.</maml:para>
<maml:para>Here is a new line.</maml:para>
<maml:para>Here is line 3.</maml:para>
<maml:para>Wow the Copyright symbol © www.culham.net</maml:para>
<maml:list>
<maml:listItem>
<maml:para>Bullet Point 1.</maml:para>
</maml:listItem>
<maml:listItem>
<maml:para>Bullet Point 2.</maml:para>
</maml:listItem>
<maml:listItem>
<maml:para>Bullet Point 3.</maml:para>
</maml:listItem>
</maml:list>
</maml:section>
</MamlContent>
</KnowledgeArticle>
</KnowledgeArticles>

 

If we import this version, we’ll have our Knowledge looking like so:

Knowledge - Imported 3

 

 

 

 

 

 

 

 

 

 

 

 

 

It’s not really all that difficult to add Knowledge to an MP as you’ve seen. But what if it’s a monitor or rule you’ve created?
How can we add knowledge to that?

Well its basically the same thing. Create your monitor or rule, and using the exact same structure, we’ll simply create a new
blob of MAML.

<KnowledgeArticle ElementID=”THIS IS THE RULE ELEMENT ID” Visible=”true”>
<MamlContent>
<maml:section xmlns:maml=”http://schemas.microsoft.com/maml/2004/10″>
<maml:title>HEADING GOES HERE</maml:title>
<maml:para>This is the first line of text.</maml:para>
</maml:section>
</MamlContent>
</KnowledgeArticle>

 

And simply dump this in between the <KnowledgeArticles></KnowledgeArticles> tags as we did with the first one.

So for the purposes of this post, I’ve just created the most basic Unit Monitor that monitors the Web Service on my Management Server and exported the Management Pack again.

Knowledge - Culham Monitor

 

 

 

 

This time we have a fair bit more XML as expected because we now have a monitor added.

Here I’ve highlighted the ID for this monitor.

Knowledge - Culham Monitor ElementID

 

 

 

 

 

 

 

 

 

 

 

 

 

You could find it here or in the Display Strings section, it’ll be the same… so we’re needing this value of “UIGeneratedMonitor3324044273b1446c9b1d4c6225bb549a”.

So if we were to want to add Knowledge to this Monitor we’d need to reference it like this:

<KnowledgeArticle ElementID=”UIGeneratedMonitor3324044273b1446c9b1d4c6225bb549a” Visible=”true”>
<MamlContent>
<maml:section xmlns:maml=”http://schemas.microsoft.com/maml/2004/10″>
<maml:title>Web Service Monitor</maml:title>
<maml:para>This Monitor watches the Web Service and alerts if it is stopped.</maml:para>
<maml:para>© www.culham.net</maml:para>
</maml:section>
</MamlContent>
</KnowledgeArticle>

And we’ll simply pop this into the same section in the Culham Knowledge MP.

Knowledge - Element ID Insert Here

 

 

 

 

 

 

So the full Knowledge section looks like this:

<KnowledgeArticles>
<KnowledgeArticle ElementID=”Culham.Knowledge.MP” Visible=”true”>
<MamlContent>
<maml:section
xmlns:maml=”http://schemas.microsoft.com/maml/2004/10″>
<maml:title>Culham Knowledge MP</maml:title>
<maml:para>This is the first line of text.</maml:para>
<maml:para>Here is a new line.</maml:para>
<maml:para>Here is line 3.</maml:para>
<maml:para>Wow the Copyright symbol © www.culham.net</maml:para>
<maml:list>
<maml:listItem>
<maml:para>Bullet Point 1.</maml:para>
</maml:listItem>
<maml:listItem>
<maml:para>Bullet Point 2.</maml:para>
</maml:listItem>
<maml:listItem>
<maml:para>Bullet Point 3.</maml:para>
</maml:listItem>
</maml:list>
</maml:section>
</MamlContent>
</KnowledgeArticle>
<KnowledgeArticle
ElementID=”UIGeneratedMonitor3324044273b1446c9b1d4c6225bb549a” Visible=”true”>
<MamlContent>
<maml:section
xmlns:maml=”http://schemas.microsoft.com/maml/2004/10″>
<maml:title>Web Service Monitor</maml:title>
<maml:para>This Monitor watches the Web Service and alerts if it
is stopped.</maml:para>
<maml:para>© www.culham.net</maml:para>
</maml:section>
</MamlContent>
</KnowledgeArticle>
</KnowledgeArticles>

So let’s import it and take a look at our Monitor again.

And if we go to the Monitors Product Knowledge Tab there’s our text.

Knowledge - Element ID Monitor

 

 

 

 

 

 

 

 

Personally I’d much rather if I were simply able to enter in plain text into the Product Knowledge window and leave it at that, Microsoft hasn’t exactly made it easy to add Knowledge but hopefully the info I’ve provided you with here helps you out a bit and encourages you to provide text for your rules, monitors and so on. It’s easy enough even if you have to do it manually as you can see, so no excuses…fill in those windows!

 
Comments

No comments yet.

Leave a Reply