Creating Custom Performance Counters in Microsoft OpsMgr (Part 2)




Written by Mark Farrugia, Senior Microsoft Premier Field Engineer.

Microsoft System Center Operations ManagerIn my previous post I started down the path of wanting to create some custom counters in Operations Manager 2007, but I could not get started until I had downloaded and installed the authoring console for Microsoft System Center Operations Manager (OpsMgr) 2007.

Now that that task was completed, let’s move on to creating the counters I wanted to get to. With the authoring console open let’s create a new management pack.

  1. Click on File and choose New.  Click on “Empty Management Pack” to create our base pack, and give the management pack a name.  This is the file name of the pack and cannot have any spaces or special characters in it.  In the work I do for my customers, I try to make all custom management packs meaningful in their naming convention, therefore I aim for the name to contain company name, department application owner and application name.  Click on Next and give the management pack a proper display name and description.  When completed, click on the Create button to finish up this wizard. Click on File and choose New.  Click on “Empty Management Pack”
  2. Now the counters we want to target are all related to the base operating system, therefore we need to add the OS MPs to reference the classes we want to target with our management pack. In the authoring console, go to File and choose “Management Pack Properties”.  On the second tab (“References”) choose to add a reference and navigate to the “C:\MP References” folder, and choose the following management packs
    • Microsoft.Windows.Server.2000.mp,
    • Microsoft.Windows.Server.2003.mp
    • Microsoft.Windows.Server.2008.Discovery.mp, and then click on OK.Management Pack Properties
  3. We have setup the foundation to start building our collection rules to gather the performance data we want.  Going to the Health Model pane, and choose the Rules stub.  On the Rules pane in the middle of the authoring console, choose New, Collection, Performance Based and Windows Performance Collection. Windows Performance Collection
     
  4. On the wizard General tab, we now have to build a proper identifiable element ID.  Our management pack already had company.department.application as a base element ID, now we will begin to add on our descriptors for our different rules to make meaningful IDs.  This particular rule is going to collect Processor % Idle Time, therefore the rule that I am going to create will have an element ID of company.department.application.processor.idletime.collection.  In that element ID I can easily identify every important piece of information that piece of XML code is executing.  Give your rule a meaningful display name and now we have to choose the Target class that this rule will execute against.  Choose to browse all classes and a new pop-up window will open. On the wizard General tab
  5. A graphical representation of the classes will be presented, which will allow you to easily browse all the classes.  Choose the appropriate target and click on OK, and then click on Next back on the wizard.A graphical representation of the classes
  6. On the Performance Counter screen click on the “Select” button to open the Select Performance Counter dialogue box, and navigate to the performance counter you want to collect data on.  In this example it % Idle Time under the Processor performance object. Click on OK to return to the wizard.Select Performance Counter
  7. All of the fields are now entered on the Performance Counter wizard screen, the only option left to set is the collection interval time.  In my example I left it at 15 minutes, but this can be changed after the rule is collected.  Click on Next to continue to the final wizard screen.Performance Counter wizard screen
  8. On the Optimized Collection screen, we are going to change the way SCOM collects performance data.  Performance data points contributes greatly to the Operations Manager database growing.  To enhance performance in Operations Manager we want to try and keep the main database as lean as possible.  This is why this performance collection rule offers the ability to tune how performance data is collected.  By enabling optimization, we have two values to choose from, Absolute and Percentage.Optimized Collection screen

If a performance sample differs by the specified value (i.e. 10%), only then will the performance sample be forwarded to the Management server. Therefore if no sample is forwarded, the RMS assumes correctly that the value is within the specified threshold and will only update the next time a sample is forwarded. This methodology saves network bandwidth, and helps to reduce database bloat.  The smaller the threshold number the more samples could get forwarded, the bigger the number the less number of samples, however performance data is more accurate with a smaller threshold.  Therefore between the optimization settings and collection interval, Operations Manager gives you a great deal of flexibility on sample collection. The only one caveat to using this setting is that once it’s set, there is no way to change the setting through the authoring console.  Click on Finish to save your rule.

  • Repeat steps 3 through 8 for any remaining rules you want collected.
  • Now all that is left is to save the Management Pack and import it

If you are interested in sealing your management pack, an excellent blog post was written by another Microsoft Premier Field Engineer named Jonathan Almquist.  You can find detailed instructions on Sealing a Management Pack on his blog.

Creating this management pack was an easy way to start introducing some concepts. As I continue to dive deeper into OpsMgr I hope to continue sharing some of what I learn with all of you.

Comments (0)

Skip to main content