Category Archives: Authoring

Just a quick post here, for those management pack developers that have run into the problem of simulating a workflow using the Visual Studio Authoring Extensions.

I have been missing the Workflow Analyzer companion to the MP Simulator for QUITE SOME TIME. I’ve tried troubleshooting the problem on several occasions, probably spending more than 10-12 hours burning midnight oil over the past months researching, debugging, sifting through logs and many Stack Overflow pages regarding .NET exceptions.

I’ve uninstalled and installed again the VSAE, and probably Visual Studio as well at some point, to no avail – the catastrophic behavior of Workflow Analyzer was clearly the bane of my development work. “The system cannot find the file specified?” What a benign message that is, especially when there is no file specified in the exception!

Just fixed it, though – out of what seems to be sheer luck.

I uninstalled Microsoft Monitoring Agent from my development workstation and installed the System Center 2012 SP1 agent – low and behold, the Workflow Analyzer sprung to life!

So happy now that I can actually see runtime data!

Here are a couple other references that didn’t provide a solution for me, but this issue seems very eluding and they might work in your case.

The requirements gathering phase of the management pack development lifecycle is critically important to the success of the project. Something that may come out of this phase is receiving company health check scripts, and this is an excellent opportunity to incorporate familiar company knowledge into a new monitoring solution.

These scripts might be used to check for some condition that may have occurred in the past n minutes or hours – n is referred to as a time offset in this case. This article will briefly describe a simple concept to a best practice around implementing this type of script in a custom data source.

This concept can be broken down into the simplest term, where n and monitoring interval share configuration.

For example, a script executes the following SQL query:

SELECTCOUNT(Column1) as [Count], Name FROM MyDatabase WHERETimestampBETWEEN DATEADD(minute,-60,GETDATE()) AND GETDATE() GROUPBY Name

The part I want to draw your attention to is the WHERE clause in the SQL query, because this is where time offset comes into the picture – it is how time offset is identified, and allows for the implementation of this coupling concept.

The query above would return records that have been written in the past 60 minutes from now. When the script is plugged into a data source, “now” is the monitoring interval, which is configured on the scheduler that triggers script execution.

Now that we know we can couple time offset with monitoring interval, we can easily use the same value for both by sharing the same configuration. In order to do this, two minor changes need to be made in any script you plan to incorporate using this concept:

1. Ensure time offset is in seconds.2. Replace the time offset value with the IntervalSeconds configuration.

In this scenario, we cover points 1 and 2 above by updating the 1st and 2nd arguments in the DATEADD function like this:

Why is using this concept a good practice?

Monitoring interval is a standard override parameter, and inevitably it will be overridden – maybe not on this particular monitor, and maybe not until you’re long gone. But don’t assume the customer is going to keep the default interval – ever.

By coupling script time offsets to monitoring intervals, a basic interval override will not cause monitor state skewing.

The question of how to manage the logical disk free space monitor comes up time and time again. Just about every customer I’ve worked with, and all over the forums, people express their disdain for and frustration of managing overrides related to this monitor – and for good reason. It’s one of those monitors that touch every type of logical disk on every computer in the environment, and of course there are going to be different threshold requirements that require overrides – even the out-of-box flexibility of using both types of thresholds (mb and %) usually isn’t enough for us to “set it and forget it”.

This a great opportunity to reduce administrative overhead by enabling local administrators to change monitoring thresholds directly on the local machine, without having to login to the console and create overrides.

Because this is such a popular request, I’ve extended the Logical Disk Free Space monitor and added it to the Windows Monitoring (Extended) community pack.

NOTE 1 – There are overrides defined in the pack that disable the vendor Logical Disk Free Space unit monitor. Once this pack is installed, that monitor will be replaced by this monitor. If you have overrides applied to the vendor monitors that you want to keep, those will need to be applied to this new unit monitor.

NOTE 2 – The unit monitor works out of the box exactly the same say as the original Logical Disk Free Space unit monitor. It will only behave differently if you implement the extended features of the unit monitor.

NOTE 3 – I chose to target Microsoft.Windows.LogicalDisk because the script data source, according to library documentation, should run fine against all versions of Windows. This reduces it from three monitors to just one.

Product knowledge has also been extended to include usage instructions:

An alert generated by this monitor will look like this:

A state change event (health explorer) for this monitor will look like this:

In this post, I want to demonstrate how easy it is to create a class using Visual Studio Authoring Extensions. This is in response to some blog posts out there (like this one and this one) that describe this task as “difficult” outside of a 3rd party tool. It’s actually extremely easy!

Yep – it’s really that easy to create a class. Now all you need to do is discover it, and it’s actually just as easy to do that, especially if you’re using the registry.

My suggestion is, if you are new to authoring management packs, just take the leap into VSAE. There is no benefit in using 3rd party tools, like MP Author by Silect. I say that because, you’re not really picking up a new skillset by using these types of UI tools – however, you do pickup a new skillset that can be useful in other areas of your job by learning the language (XML).

There is a learning curve to everything – make the wise choice for your career.