An Evolution of Fragments
Here at Silect, we love fragments. We have added support to both MP Studio and MP Author Pro to allow users to:
- Download fragments from GitHub
- Index them to make finding the correct fragment easy
- Browse for the correct parameter values
- Import them into a management pack
- Edit fragments and even create your own fragments
The new Silect Portal also allows importing fragments (but more about that later).
And our customers love them too. The ability to quickly add new workflows to a management pack (MP), in a consistent and reproducible manner has been very popular. Many customers take the available fragments and create a company specific library of modified fragments which meet their exact needs and standards.
Of course, there are always things that could be better. Importing fragments is quick and easy, but it is not as easy to update a parameter used when importing a fragment. Just changing an event ID might result in searching through various workflows to find where it is used, and that can include the names and display names of those workflows. And you may need to edit the raw XML to do that.
Deleting a fragment is even harder. You need to examine the fragment to see what workflows it would have added, and then find and delete them. But the worst case is needing to update a fragment when the implementation has changed. In that case you need to look at the existing workflows to figure out what parameters were initially used, then delete the old, and finally import the new version of the fragment with the parameters you discovered.
But we have a solution.
New in version 10.0 of MP Studio, MP Author Pro and the Silect Portal is support for a new type of MP which we are calling an MPF file (Management Pack Fragment). The MPF file primarily consists of a list of fragments and parameters that you want added to an MP. There is an input MP, which can contain any workflows you want, and then the MPF file is applied to the input MP to produce an output MP. The output MP ends up with all the workflows from the input MP as well as all those added by importing all the fragments.
This diagram shows how all the parts fit together.
The Management Pack on the left is a normal unsealed MP. It can be empty, or it can have other workflows already added.
The MPF file in the middle, refers to the input MP, and has a reference to an output folder. And, of course, a list of fragments to be added to the input MP.
When the MPF file is built, it loads the input MP, imports all the fragments, and then writes the output MP to the output folder. The output MP can be deployed to SCOM. You should not edit the output MP so if you need to make changes, update the input MP or the MPF file, and rebuild.
Because the output MP has the same name as the input MP, it needs to be stored in a different folder to avoid confusion. We typically use a subfolder named Output, but you are free to use your own standard.
If you want to add new fragments, change existing fragment parameters, or delete a fragment, you just make the change to the MPF file and rebuild. The output MP will have exactly what you want, with no need to dig into the XML of a MP.
MP Studio and MP Author Pro both have forms to edit MPF files, along with Validate and Build commands. The Silect Portal will add fragments to an MPF file. And we also have PowerShell cmdlets to add fragments to MPF files, Validate MPF files, and Build MPF files, so automation and integration with 3rd party tools is easy. The validate commands, and the MPF editor form, will even warn you if a fragment has been updated since you added it to the MPF file, so you can review to ensure the current parameters are compatible with the new version.
Some people might be wondering if MPF files have changed the way they currently work. No, MPF files are an additional way to author MP files, but there were no changes to the old ways of doing things. You can still open MPs and import fragments, just like you have been able to do for years. There were no changes to the way MP Studio and MP Author Pro import fragments into management packs, and no changes to fragment files either.
So, you can continue using fragments the way you always have, but you should give MPF files a try. We feel they will make your life easier.