Using the Visual Studio Authoring Extensions to build your management packs, one extremely useful piece of functionality is the ability to create multiple rules/monitors/discoveries/tasks/views etc. using management pack template groups. The reason this functionality is so good is because:
1. Easy to Create
Working with Visual Studio will put a lot of IT Pro’s off using the Visual Studio Authoring Extensions, so they have to as easy as possible to use, and the management pack template groups are certainly easy to create and use! All you need to do to create a new template group is simply right-click in your solution and select Add -> New Item…
and then pick the relevant template…
and then name as required.
2. No XML required
VSAE adds a UI to create monitoring components such as rules and monitors. Using this UI it is possible to configure all the available settings such as name, target, data source, ID, description etc etc. and it will configure all the relevant display strings automatically!
— OK, so I’ll be honest here… Sometimes there may be a requirement to work with the XML a little bit. When working with some items, like rules, you need to configure the data source type the rule is going to use, and usually the data source type will require some configuration items to be passed, and it is this configuration that you will need to configure in the XML. The screen clipping below is displaying the configuration XML for the data source selected.
This isn’t as bas as it seems though, as you can use intellisense to return the configuration items required in the XML. Simply hit Ctrl+Space and the configuration item will be available to select, as you can see with SyncTime above. Once the SyncTime has been configured, hit return and do Ctrl+Space again to see if another configuration item is required.
3. Copy & Paste
One of my biggest issues with the SCOM 2007 R2 Authoring Console was that it was not possible to copy and paste. In many cases I had the requirement to create tens, if not hundreds, of rules that were all identical apart from a couple of minor configuration changes, and in the old authoring tool I would have to create each one manually or break out into the XML and copy and paste the relevant rule and display strings. Neither of these solutions were great as they were both very time consuming, but this issue is now resolved using VSAE as after I have created my first rule, I can simply copy and paste and then simply edit the configuration items as required.
It’s not just rules that can be copied and pasted though, any template item can be. The next item below covers all the available template types.
4. 14 Templates Available
There are 14 templates available which will cover the majority of your authoring needs! They are:
- Agent Task (Custom)
- Agent Task (PowerShell Script)
- Agent Task (Windows Script)
- Assembly Resource
- Monitor (Aggregate)
- Monitor (Dependency)
- Monitor (Unit)
- Rule (Alert)
- Rule (Custom)
- Rule (Event Collection)
- Rule (Performance Collection)
- View (Custom)
5. Auto-Generated MPX
When using template groups, an MPX file is created automatically which enables you to view the XML behind the UI if you so wish.
WARNING: Do not edit the .mpx file as these changes will not be saved.
MPX files are management pack fragments, and you can have multiple MPX files within an MP. When you build the MP, all the MPX files are combined to form the management pack.
So, they are my top reasons for what makes template groups so good! There are many more as well, but these are the key ones in my opinion that cover all the the different template types.
Happy MP writing all 🙂