It has been a long time since my last post, this summer has been long and busy and writing (poorly) in English takes so much time. Anyway I have several notes that need to be shared, I hope to be able to turn them into articles quickly in the next few weeks. First of all I want to start from a promise I made in this blog, in Italy we say every promise is a debt, and so here we are.
Sure enough process monitoring is a task that well adapts to the business hours cycle, alas the standard template provided by the Microsoft.SystemCenter.Process.Library management pack doesn’t allow to specify business hours. So I took my time to check how to create my own MP to have a business hours filter for process monitoring. My final goal is to recode the standard wizard to add a scheduler filter page and then have all the monitors to take into account this filter. This proved to be challenging since there’s no documentation on creating templates and there’s no documentation on built in forms (UIPage) that you can use in your wizard (UIPageSet). So getting to the final goal is going to take a lot of time in reverse engineering, I still want to get there, but as an intermediate step, I’ll show how to modify the template to add a scheduler filter for the business hours constrain. In this first step the wizard won’t ask for the business hours filter, instead, once the MP is created, you’ll need to use overrides to set the required business hours, by default the monitors will always run.
Before getting into the real stuff a quick background. The standard Process Library template can create the following monitors (I will skip the rules for this post):
Based on your choices in the wizard one or more of these monitors will be enabled, anyway all of them will be created in your wizard derived management pack. It seems the template schema has no conditionals to skip unwanted code snippets.
All of these monitors are scheduler based, so they’re executed every x seconds, what we need to add is a System.SchedulerFilter as we did in previous posts on business hours monitoring. To make things manageable I chose to have an inclusive filter (OnSchedule) filtered by days of week and days hours, to be clear, in this way, we can build a monitor that runs from Monday to Friday from 08:00 AM to 08:00 PM.
The steps required are:
- copy the Microsoft.SystemCenter.Process.Library and unseal it, we need the XML format
- modify the monitor types to add a SchedulerFilter
- modify the template so that it generates the monitors with the proper parameters (i.e. the ones needed for the SchedulerFilter)
- IF we want to have our own template we must rename the whole stuff, keeping the references, when needed, to the Microsoft.SystemCenter.Process.Library / OR / we must remove the Microsoft.SystemCenter.Process.Library MP and import our own
Beware, until the MP is sealed all the new monitors will be created in place. So it’s a good idea to seal it.
Let’s take a closer look at the steps.
First we need to add the needed parameters to the configuration tag of the monitors, in our case the bitmap for the week days (days) and the time range (from, to)
Then we need to add a module to the member modules section
Finally, as usual, we just need to add the filter to the regular detections.
The entire process is mainly a copy and paste one and very similar to what we’ve seen in other business hours related posts, but then there’s the template part, where we need to integrate the new parameters (days, from, to) in the template for the actual monitor
But we’re not finished yet, we must rename the template and set all the references to the original Microsoft.SystemCenter.Process.Library MP, then every template must have its own folder
As you can see, there’s a lot of work to be done even for this first simple attempt, to make things easier you can download a mock MP here. Since it’s not sealed all your monitors will be crated in place.
Once the MP is ready and imported you can create a new process monitor using the new template, then you must add an override to set up the proper business hours filter. Here’s the step by step guide after the wizard is complete:
This posting is provided "AS IS" with no warranties, and confers no rights.