This post deals with 2 situations I’ve come across time and time again. One is the lack of documentation about any customizations made and the other is the general lack of any decent tutorials on using the authoring console – so I’ll combine them!
Documentation – the bane of any monitoring engineer. With a system such as OpsMgr, a lot of it is self-aware and as such, rules and monitors will deploy on their own according to what happens in a server. Someone installs IIS? Well then OpsMgr will notice and download the appropriate rules and monitors and assign them to the new groups they belong to. That’s a tough thing to stay on top of, and once I have an OpsMgr 07 version of MOMDOC, I’ll release it and make all of our lives easier – until then you’ll have to put up with it.
The other side of documentation is the general lack of it with regards to custom rules, monitors, transactions and changes made to ‘out of the box’ rules. This is a very solveable problem!
First off, go ahead and download the Authoring Console. It’s been out for 8 months now, and technically not needed for this particular management pack, but it’s a great way to ease into how it all works.
For this demonstration, I’m going to create a management pack which makes a new task called “Search Internal Documentation”. This task simply opens a browser window appending the alert name to a URL for an internal ScrewTurn Wiki. ScrewTurn is a great open-source ASP.Net wiki which doesn’t require an SQL database, making it very easy to ‘sneak in under the radar’ in a lot of environments.
After you’ve downloaded, installed, and opened the Authoring Console, click on File > New, to create a new management pack. Under “Management Pack Template” click on “Empty Management Pack” and give it a name – I used Internal.Documentation.Search
Selecting an MP template and name it
Click on “Next” and give it a Display Name and Description. Use what I did, or enter your own information.
Entering display name and description
Immediately you’re assaulted with a whole army of choices; Sevice Model, Health Model, Presentation, Type Library, Language Packs, and all of the things inside of those. We’ll get to all of those, eventually, but for now click on the ‘Presentation’ tab on the left, then New and Console Task on the right.
SCOM - New Console Task
Up will pop up a window asking for a unique identifier. This is an internal reference used inside the Management Pack, so give it a descriptive name, something like “Search.Wiki”.
Choosing a Unique Identifier
Click ok, and now you have all of the options for our new task.
The ‘General’ tab is where you give your task a public name, description and choose the target. You can see from my example I’ve named this task “Search the Wiki” with the description of “Search the internal wiki about this alert”. Under the target click to expand it, choose ‘Browse all classes’, then search for the “System.Entity”. This will allow our task to be shown and run against all alerts from all management packs.
The general pane of the new task window
Now click on the ‘Command Line’ tab – this is where the meat of it is. Here is where we define exactly what our task will do.
Command Line pane showing the definitions for the task
As you can see from my example above, I’ve specified the command line options to open up our Wiki. The command line application was set to use Internet Explorer ((If you use a different default browser at your organization, then enter it’s path here)), and the parameter I use is the URL t0 the wiki with $NAME$ (The alert name) and “.ashx” appended to it.
Tip: If you’d rather have the URL opened in whatever the default browser the user has, you can change the application to use start.exe to open it, or even just use the URL itself. If it’s a known extension, it will be opened by whatever the default handler is for it.
Product knowledge is what we’re used to, enter what you see fit in here, then click on the Options tab and change Accessibility to “Public”, and Category to “Alert”. This allows the task to be used directly from the console, and shown in any alert view.
Setting the additional options
Then click OK, it will crunch for a little bit saving your changes, and then bam – there you go – a brand new task is born!
The completed new task
Now click on File > Save, choose a spot (and a name if you’d like) and there you have it, a brand new management pack. Now go ahead and import it, like you’d import any management pack. Click on the Monitoring tab, then on Active Alerts and select an alert. In the actions pane you should see our new task shown under the “Alert Tasks” heading.
Our new 'Search the Wiki' task
For this example I highlighted an alert that was “Percentage of Committed Memory in Use Too High” and clicked on ‘Search the wiki’. Since that page doesn’t yet exist, it suggested a few I’ve created that sound close to it, or alternatively you have the option to create it as a brand new page. Pretty slick, eh?