SCOM: Automating Management Pack Documentation
August 19, 2009 4 Comments
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.
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


