SCOM: Automating Management Pack Documentation

It’s easy to argue the case for keeping accurate documentation of SCOM management pack monitors and customizations, both for the abstract purpose of maintaining good documentation, as well as the more practical purpose of being able to answer the “can you list what is being monitored?” question. However, it can be tedious to keep on top of this documentation. But, given the flexibility of the SCOM command shell, it’s relatively easy to configure a powershell script to automate the documentation of management pack entities. By using a script to loop through unsealed management packs and itemize management pack entities such as groups, rules, monitors and views, along with their description, all it takes to automate documentation of custom management packs is completing the description fields for objects as they are created.

To loop through unsealed management packs, we can defined the list of management packs as an object:

$mps = Get-ManagementPack | where-object{$_.Sealed -eq $false} |Sort-Object DisplayName

Then create the loop logic:

foreach($mp in $mps)
{
  $mpDisplayName=$mp.DisplayName
…functions to list MP objects
}

With a set of functions to list the management pack objects that write the object lists to a formatted file (I use an HTML file so I can utilize CSS for formatting), we can create an automatically-generated document covering all unsealed MP’s.

I’ve posted the script I use here.   This script exports groups, rules, monitors, and views for all unsealed management packs in a formatted html file.  As always, it is provided as-is.

https://i0.wp.com/jxjzig.bay.livefilestore.com/y1pjtnzM9RDmStqJ-ZMgzC1HYtJbO2G9rUylcr1AiV5DQ5Jrq_vO2QlZZom8juYCZgFcLGCiQJe1qd2v4aOE2wb4w/report.JPG

My preference is to combine a single scheduled task that runs this documentation script as well as an automated export of all unsealed management packs. The output of both of these processes is then backed up nightly, creating a hands-off set of documentation and management pack history that can be utilized as necessary.

More on exporting unsealed MP’s for backup can be found at: http://searchwindowsserver.techtarget.com/generic/0,295582,sid68_gci1317380,00.html

About Kristopher Bash
Kris is a Senior Program Manager at Microsoft, working on UNIX and Linux management features in Microsoft System Center. Prior to joining Microsoft, Kris worked in systems management, server administration, and IT operations for nearly 15 years.

4 Responses to SCOM: Automating Management Pack Documentation

  1. Pete Zerger says:

    Nice articles. On a related topic, we actually created a management pack that will backup and archive unsealed MPs for a user defined number of days.

    http://www.systemcentercentral.com/PackCatalog/PackCatalogDetails/tabid/145/IndexID/11522/Default.aspx

    • Kristopher Bash says:

      Thanks, and I must say that your site is probably my #1 go-to reference for SCOM, keep up the good work! That MP looks like a much more robust way (as opposed to a basic scheduled task) to perform backups of unsealed managment packs. What I was really trying to illustrate though was a method that I use via a PowerShell script to generate HTML files that list the components of an MP (Groups, Rules, Monitors, and Views) for output as an HTML file, in order to auto-generate basic documentation of the Management Pack, which is something that I couple with the backup process, but I do like that approach of using SCOM scheduled tasks to do the work.

  2. Pingback: SCOM2007: How to document your SCOM Installation - Dieter's System Center Blog

  3. Pingback: SCOM2007: How to document your SCOM Installation | DW-IT

Leave a comment