Rory Primrose

Learn from my mistakes, you don't have time to make them yourself

View project on GitHub

Creating SCOM event collection records from database records

SCOM supports collecting event records that can be reported on. It has inbuilt support for reading the Windows Event Log or a CSV file, but becomes limited beyond that. I played with the idea of getting SCOM to read records out from a database in order to populate these SCOM events. Unfortunately there is not much information on the net about how to get it to work.

The attached SCOM management pack shows an example of how to get this to work. It uses a Microsoft.Windows.TimedScript.EventProvider to read database records into a PropertyBag and to define how the database fields map to SCOM fields. A rule data source then points to the EventProvider and provides the configuration options for hitting the database.

A word of caution though, you need to be careful not to dump too much information into the SCOM data warehouse as it is not designed for collecting large amounts of event records in this manner.

Neovolve.ScomEvents.xml (17.32 kb)

Read More

Psexec hangs in TeamBuild script when invoking msiexec on remote machine

I’ve come across this one a few times and I can never remember what the answer is off the top of my head.

We are getting the msbuild script to execute psexec to invoke msiexec on a host machine to install an msi compiled by the build script. This is done so that the build script can then execute integration and load tests on the deployed application.

In modifying the build script, it seems like I have accidentally changed the psexec arguments which has caused psexec to hang on the build agent. In this case, it is happening when -accepteula is not passed to psexec.

The build script should look like this for executing psexec -> msiexec.

Read More

AOP with PostSharp.Laos

PostSharp.Laos is a Lightweight Aspect-Orientated System for PostSharp that makes it really easy to include AOP in your code. In this demo, PostSharp will be used to aspect the RunTest() method in the following application. The aspect will output console messages before and after the aspected method is executed.

Read More

AOP with PostSharp

PostSharp is a very power AOP framework. It changes the IL emitted from the compiler according to the aspects that it finds. The way PostSharp can be implemented ranges from very easy to very complex.

The demos in this series will look at a very simple scenario. PostSharp will be used to aspect the RunTest() method in the following code. The aspect used will output console messages surrounding the RunTest method.

Read More

Styles of AOP

There are many AOP frameworks around and they all use one of just a few techniques to inject code into join points. Oren has previously posted a list of these types of AOP techniques with their advantages and disadvantages. This list is copied below for reference:

Read More

TeamBuild - Custom build steps

I’ve been working with team build a fair bit over the last month. Yesterday I was bouncing through the MSDN documentation during my MSBuild travels and I came across a very handy build task. The BuildStep task allows you to create custom entries in the build report.

Take the following build target for example:

Read More

TFS pet hate - changes should be for changes

I love TFS, but there is one thing that grates me. Check ins with no changes are very frustrating. I’m reviewing a branch for a service and half the edit and merge changes don’t have changes. It’s not a big deal, but it would be good if the "noise" in the change sets wasn’t there.

Read More

Going to CodeCampOz 2009

I’m really looking forward to Code Camp this weekend (nerd camp my mother-in-law calls it). It should be a great weekend of sessions and networking. Hopefully I’ll get to catch up with friends and meet some great new people.

See you there!

Read More

The pitch – Invade New Zealand

I just saw the first episode in the latest season of the Gruen Transfer. The concept of the show is classic and the idea of “The pitch” is simply gold.

Watching this episode reminded me of a pitch from last year about selling the idea of invading New Zealand. My favourite was the advert that lost the competition, but I just have to link to it for posterity.

Read More

GhostDoc feature in hiding - Roland already has the goods!

As I was writing and using my custom GhostDoc rules (here and here), I was thinking that it would be nice if GhostDoc was able to clear the existing documentation and then apply the DocumentThis command. I emailed Roland Weigelt about the feature idea not realising there is a forum for feature requests. He quickly replied saying that the feature is already there albeit undocumented. This is exactly what I was after.

If you open up the keyboard bindings and do a search for GhostDoc, you will find a RebuildDocumentation command.

GhostDoc keyboard bindings

I have assigned the RebuildDocumentation to a Ctrl+Shift+D, Ctrl+Shift+R combination and changed DocumentThis to Ctrl+Shift+D, Ctrl+Shift+D combination. Roland said to make sure that the new keyboard binding is only used in Text Editor (as highlighted above).

Read More