Fragments
What is a fragment?
“A Management Pack fragment is simply a bit XML that contains all the working parts for a specific workflow.” – Kevin Holman, Microsoft PFE
Put another way, a fragment is an XML document with parameters (placeholders) that define elements, which once the parameters are replaced and the fragment is merged with an MP adds new workflows and other elements to an MP.
How do fragments help?
Fragments can greatly simplify the creation of new Management Packs or adding elements to existing MPs. MP Author Professional, MP Studio and the Visual Studio Authoring Extensions all provide integrated support to add and customize fragments to the MPs you are working with.
Fragments can be re-used over and over which make it possible to add a large number of similar elements to a Management Pack quickly and consistently.
When should I use a fragment?
Use a fragment if you want an EASY and FAST way to author your Management Pack.
Use a fragment if the Management Pack you are creating requires more than 1 similar element (rule, monitor, discovery, class, etc.). If the application has several Windows services for example and you need a basic monitor with alerting capabilities.
What makes it easy is that the fragment contains all the necessary XML that’s required for a workflow, but a user doesn’t need to understand all the XML nor do they need to create the XML from scratch. What makes it fast is the fragment contains important parameters which may be used in several places in the XML that makes up the individual element. You only need enter the parameter information once to complete the creation of a new workflow.
Fragment Resources
- Silect fragments: https://github.com/SilectSoftware/Fragments
- Kevin Holman’s fragments: https://github.com/thekevinholman/FragmentLibrary
- Authoring Management Packs using Fragments webinar: https://youtu.be/OF_wi17X7mM
- Kevin Holman (the creator of fragments): https://kevinholman.com/
- Advanced Management Pack Authoring using Fragments webinar: https://youtu.be/IGFoh2qcUJ4
Fragment Support in Silect MP Author Pro / MP Studio
Using fragments in MP Author Pro or MP Studio to make an awesome Management Pack is really easy. First find the fragment you need:
Then fill in or better yet browse to find the appropriate parameters:
Congratulations! You’ve just added a new workflow to your Management Pack!