SCOM Author Meets the REAL VS Authoring Extensions

19 Feb

Yhea! Now its time for the real stuff. In my last post I mentioned the Visual studio Authoring Extensions. And now I am going to give you a first quick hands on. We are going to build an management pack that will discover all your Symantec Agents and monitor the running state of it. When not running it will give an error and a unhealthy state. Pretty easy stuff for you reading this blog but its not the MP but the Authoring VS extensions that have the focus here.

Okay here we go.

First this. This blog post is based on a pre build and can contain other features that may or may not be present in the RTM build.

After installing the VS Authoring extensions we startup VS and select to create a new project.

image

Now select the Management Pack –> Operations Manager –>

You will see for now 2 project templates. We select the Core template and fill in a good name.

SNAGHTMLb67fb6a 

We have now a empty MP project. So next we have to think what we need to create for this MP.

1) Class type for the Symantec Agent

2) Discovery rule to discover the Symantec Agent

3) Monitor rule for the NT service Check of the Symantec Agent

4) Views to display the Symantec health state.

1 Class Type

As always we start at number 1. Go to add a project item for the class to create. Right click on the project and add –> New Item

image

Go to the XML templates and choose Class. And give it the correct name.

SNAGHTMLb742621

If you choose a item template out of the XML folder it will means that you will have to go type the old fashioned XML again. Ill think this will be replaced by an real class create template wizard soon. I hope so…

So said that we open the just created Class MP fragment. And we change the class internal / display name first. Next we change the base to “Windows!Microsoft.Windows.LocalApplication” because I like to use this predefined MS class. Oh do not to forget to set the Hosted to true. As a bonus we add a property “ProductVersion” as a string value.

image

And yes we have finished step 1.

2 Discovery rule

To create class instances for the class created in step 1 we need a discovery rule. Since the best way to discover the Symantec agent is the registry we are going to use a registry key discovery rule. So when a windows computer has the Symantec agent on it a new class instance Symantec agent will be created and the product version number will be filled in. The registry key to check for the agent service existence is “SYSTEM\CurrentControlSet\services\Symantec AntiVirus” and for the product version “SOFTWARE\Symantec\Symantec Endpoint Protection\SMC\ProductVersion”.

Again next we are going to add a project item. This time it will be a Discovery template.

SNAGHTMLb85baa3

Good for us it is a real template so (almost) no need for XML. 

SNAGHTMLb8889b4

Take a good look at what you are seeing now. On the left you will see all the objects created by the templates. In this case it will be one. But you can create more by pressing right click. On on right side we see the property window. And this is the most important one. All the wizard stuff we where having in the ‘normal’ authoring console is gone. You will have to use the property window to supply the values. It looks a bit more work but its not so bad at all because most of the properties have filled select lists behind it.

So we are going to specify the properties. After we fill in the common properties as: Display name , ID , Description, we start with the Module –> Datasource Type ID . Press on the … icon. And choose the filtered registry module type.

SNAGHTMLb914ec7

  Next is to specify the Module type configuration. Go to the “Data Source Configuration” and press on the (Configuration XML). And now we have to type in the registry configuration  by using XML. Hope this will be changed to a wizard later on. For now we will have to create the XML by hand. Good for us the is a XSL schema helping out. We are going to use the registry keys mentioned earlier in this module.

SNAGHTMLb9cd45b

Next we specify the class instance to create. This is a bit more click work but very self explaining.

SNAGHTMLba12316

The complete discovery properties will be at the end.

image

 

3 Monitor rule

Now the real core why we are making this MP. The monitoring check of the Symantec Agent service state. Again we add a new project item. This time we select the Templates –>  Monitor (unit) template.

SNAGHTMLba843b1

 

And again we have to specify the properties. After the general ones we set the Target for this monitor.

image

Select the Class we have created in step 1.

SNAGHTMLbb2beaa

Now we have to specify the Monitoring module type to use.

image

And we select the NT service monitor module type.

SNAGHTMLbb6af20

Next the parent monitor for the heath rollup

image

SNAGHTMLbb76a92

And also important the instance states to use.

image

SNAGHTMLbb868ed

But the most important is of course the configuration of the module type.

image

And again we have to type XML with XSL schema help. We will have to know first the NT service name. Lets use PowerShell to get this name instead to the SC command.

SNAGHTMLbbba16a

So the name will be “Symantec AntiVirus”. So the XML configuration will be:

SNAGHTMLbbd333d

The complete final properties list will be:

SNAGHTMLbc0339b

 

Now the MP is operational , you could now build and import it , but some end user view would be nice too.

4 Views to display

We are going to create 2 state views in a folder.  One showing all Agent states and one showing only the unhealthy ones.

And yes , I know what you are thinking …. we are going to add a new project item Knipogende emoticon

We start with creating a folder to hold the views.

SNAGHTMLbc684a7

We have to specify the folder in XML:

image

Now we have the folder we are going to create the views. Templates –> View (Custom)

SNAGHTMLbc8ec3f

 

this time we have to use the properties to specify the view configurations. We fill in the common ones.

image

And we specify the View configuration and View Folder.

For the second view showing the unhealthy ones  we have to specify the View Configuration as below:

image

SNAGHTMLbcf8e67

 

And yes yes we are ready to build !!!!

Simply press F6 to build. Now after a successful build go to the management pack created.

image

The MP file location will be :

image

and the MP (unsealed) file will be here:

SNAGHTMLbd21800

At this point you can test the MP with the already super tool Authoring Console with the Work flow simulator. If all is okay you can do the last step.

Last step is to import the MP into the SCOM MNG group. An no we don’t have to do this by hand!! We can do it from out of VS too.

Go to the project properties and select the “Management Group” tab.

image

Add a new MNG connection.

After testing the connection you can simply press F5 to build and deploy the unsealed MP to the MNG group.

If you want a sealed one you must specify in the build tab a certificate.

SNAGHTMLbd82c4b

So simple as this it is….

So now you have created your first MP with the new VS authoring Extensions. But WAIT what did we forget !!!! Check-in the solution into Visual Source Safe … really use a Source Safe system to safe your live some day!!!

Next time I will blog more about this super cool new authoring tool. I think I am going to take you guys on the how to create a dashboard widget tour….

Hope you liked this blog and …..

Happy Scomming.

Michel Kamp

2 Responses to “SCOM Author Meets the REAL VS Authoring Extensions”

  1. Test February 18, 2015 at 00:58 #

    Ultimate Article .

    • Test February 18, 2015 at 00:59 #

      Can you please explain the Custom moudles.

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

%d bloggers like this: