Creating helpful HTML reports from SCOM Management Packs
I guess, that almost every SCOM Admin get some kind of these questions from an Application owner every now and then:
- Can I get a readable report of all workflows stored in a Management Pack?
- Oh and while we at it, can you please include:
- All override able parameter and their current (default) thresholds
- All existing Overrides for these parameters, including their specific settings
- All possible states for a monitor (e.g. to detect manual reset monitors)
Does that sound familiar to you? How do you deal with these questions? Refer the Application owner to the MP guide? What if there is none or if it does not include the information needed?
I get those kind of questions on a regular basis and decided to write a PowerShell function that creates a HTML report allowing to answer at least answers some of these question: Convert-MPtoHTML
- This function is work in progress and might get extended over time. If you have any additional requirements or notice any flaws, please let me know.
- Regarding the design of the report: As you can immediately see I am NOT a CSS specialist nor do I have a sense for colors, so please excuse the fancy colors :)
Exporting a Management Pack to HTML can be quite tricky. Some challenges I faced:
- There are a lot of different variations and scenarios that needs to be covered for all the different workflows.
- What is the best way to retrieve information from a MP? Use the raw XML and parse and process it or use the .NET Methods from the SDK?
- Do I only cover MPs stored in a Management Group or do I also cover any kind of MP that exists as a file in the filesystem?
I decided to leverage the SCOM SDK and its methods. So my function requires a working connection to a SCOM Management Group, but will also work with any kind of MP stored in the file system.
I have tested the function with hundreds of different MPs and at the moment I have not seen any errors, so I guess, that I covered 99% of all different scenarios. But unfortunately I can’t be sure. So if you notice any error while using the function, please let me know.
Convert-MPtoHTML – the resulting HTML report
Before I explain the usage of the function, let’s have a look at the results it produces. You can view a full example for the "System Center Core Monitoring" MP report as a zipped html file here.
Let's digg into some details of the resulting HTML report:
The report header
As the MP can be either originated from an existing Management Group of from a file, the header of the report reflects that:
In case of using a MP from a Management Group, the header warns, that the data is based on a point of time view regarding overrides and thresholds:
In case of a file based MP, it warns, that no overrides can be shown and that other data might be missed as well:
Additionally, the report is a little bit dynamic and allows for navigating to the different items of a MP.
If a MP does not contain certain items (e.g. the SQL Monitoring MP does not contain any Folders and views), this section is empty:
Otherwise you would see the details like this…
… or this:
Monitors and Rules
For workflows like Monitors and Rules you see specific and detailed information like:
- Workflow target
- Monitor states
- Overrideable parameter and its default values
- Overrides and their specific values if existing
The next screenshot shows an example Monitor containing all of these data:
Convert-MPtoHTML – function usage
The function is tested under SCOM 2012 R2 UR11 and SCOM 2016 UR2. It comes with a built in comment based help, so you can get all the details by typing:
PS> help convert-mptohtml -full
So lets see some examples:
Export all MPs of the current Management Group to HTML and store the result in the folder C:\temp\MPReports by using an empty string as the MP name:
PS> convert-MPtoHTML -MPName "" -outputdir c:\temp\MPReports
PS> convert-MPtoHTML -MPPath "C:\Temp\MPReport\Microsoft.Windows.Server.2012.Monitoring.mp" -verbose
The last example creates a html report for all MPs matching 'sql' in either Name or DisplayName property. These MP(s) needs to be available in the current (local) Management Group:
PS> convert-MPtoHTML -MPName "sql"
Convert-MPtoHTML – download
You can download the most current version of the function at TechNet Gallery.
The function convert-mptohtml creates a detailed html report of a specific MP. This report hopefully can help you as a SCOM Admin in discussions with your Application owners.
If you find this function useful, please let me know. Feedback is always welcome :)