Customising your monitoring

If you are anything like me you’ve always been the sort of person that likes to take things apart and see how they work. For me it started with my first toys and then my bikes and then my cars. Customising these things made them better and also just a little bit more ‘mine’.

I am the same when it comes to computers, call me curious but I love being able to make my PCs or servers better than when they came off the shelf. Not much software lets you do this. You can start at changing Office Ribbon buttons or Outlook rules or writing macros in other applications but when it comes to specialist applications there aren’t many around that let a DBA roll their sleeves up and make it do something special.

Until now.

SQL Monitor from Red Gate let’s you write your own T-SQL and store it as a piece of code to gather details from your SQL Servers that you want to monitor. You write the code, set the frequency and which servers and databases to run it against. Even better, you can then tell SQL Monitor to keep an eye on the values it’s collecting and if it gets too high or too slow or what ever you want then it can fire an Alert that let’s you know what’s going on.

What if you don’t know what to do, well there are some example metrics that you can take for free and use them to monitor your servers and then copy and adapt to suit your own requirements. They can all be found at but even if you don’t have SQL Monitor yet I’d wholly recommend taking a look at the custom metrics as they come from some great names in the SQL Server world Stuart Ainsworth, Fabiano Amorim, TJay Belt, Louis Davidson, Grant Fritchey, Brad McGehee and me. Not too sure that I deserve to be mentioned too closely next to these guys but I am proud to a have been one of the first contributors to this project. That’s right, one of the first.

The website is going to become an open library of custom metrics that anyone can contribute towards. Head over there and download some of the sample custom metric code and see how its working, what its doing and then go and make it better. Once you have customised the code to your liking, bring it back to the site and submit it back into the library so others can take a look and move it on in a way they need it to. They’ll bring it back and you can benefit from their efforts too 🙂 You’ll all get credited for your efforts and be helping your fellow SQL Server users.

FriendOfRedGate_PLUS-LOGO_RGB_10pct.jpgDisclaimer – Jonathan is a Friend of Red Gate and as such, whenever they are discussed, will have a generally positive disposition towards Red Gate tools. Other tools are often available and you should always try others before you come back and buy the Red Gate ones. All code in this blog is provided “as is” and no guarantee, warranty or accuracy is applicable or inferred, run the code on a test server and be sure to understand it before you run it on a server that means a lot to you or your manager.