This is a longer blog post, so please bear with me. Read on if you are interested in how to create a truly useful knowledge base for Operations Manager which offers a lot more than the built-in knowledge management. I’ve done this a couple of years ago for some customers based on Microsoft Office SharePoint Server 2007 and wanted to update the solution to the most recent SharePoint version 2013.
Just to be clear, if you are authoring management packs for a specific product (like Microsoft is authoring MPs such as Exchange or Dell is authoring MPs for their hardware) this is not for you. The target audience are admins of companies who operate and use Operations Manager to monitor their infrastructure and applications. Knowledge management in SCOM (Company Knowledge) isn’t easy and straight forward. It requires you to install a lot of pre-requisites and tools to just get started. The handling of KBs in SCOM in general isn’t very good. I can only see one advantage/feature in using company knowledge: it offers linking of tasks or views but that’s it. Using something like SharePoint offers much more...
Frankly, it’s not really about SharePoint at all. Most other Wiki products, even in-house developed applications can be integrated and tied up together as demonstrated in this blog post. The implementation details may be different but in general this approach works with almost all products which offers you a minimum set of URLs to control whether an article should be created or displayed. I chose SharePoint for the following reasons:
- It’s a product from Microsoft and already well established in many companies. Those companies may also have good SharePoint know how.
- I’m not a SharePoint fan or specialist but I had a couple of situations where I needed to work with it. So it kind of felt familiar using something I already knew instead of picking something completely new.
- Feature wise, SharePoint offers many things which are desirable for knowledge bases:
- Integrated indexing and search.
- Access control/permissions if you want or need.
- Other departments can contribute and enrich knowledge base without having access to the SCOM console.
- Versioning of articles.
- Extensible and highly customizable. Additional metadata for your KBs like department, responsibilities, owner, etc. can be entered and used.
This example is shown with a SharePoint Enterprise Wiki Site (which requires the SharePoint Server!). Other wiki products may have similar features. You can also use SharePoint Foundation with a Wiki Page Library. In this case you cannot have any custom layouts and content types.
General Approach: High Level Overview
It all starts with an Alert Task in SCOM. The basic idea is that the user/operator selects an alert in one of the alert views and clicks on an Alert Task (which is executed on the console machine where the SCOM console is running). In general, this console task will open an URL in the default browser and passes on the name of the alert. Alternatively you can also pass in the Alert ID and access the SCOM APIs to get all the alert data needed to continue processing.
The web page which is opened by this task needs to do the following:
- Normalize the alert name (remove all unsupported/not allowed characters)
- Use the normalized name to see if a knowledge base article with this name already exists. If yes, just redirect to the article.
- If the article doesn’t exist yet, redirect to a different page which ideally accepts the normalized name to pre-populate the form to enter a new KB article for the alert name.
That’s it. Easy, right? ; )
Let start with the easy part. First, create a management pack for the task in the Administration space. You can also import the sample MP provided in the zip file and modify the task.
In case you start from scratch, go to the Authoring space, expand the Management Pack Objects and right-click on the Tasks node. Select Create a New Task in the context menu. Select Console Task / Alert command line as the Task Type and make sure you select the previously created management pack at the bottom of the page. Specify a meaningful task name like “Open Knowledge Base”. Note that the name you enter here is the name which shows up in the Tasks panel when you select an alert.
Configure the task as above.
Parameters: /c "start "" "http://sclab-sp/kb/Pages/customredirect.aspx?name=$Name$"
We need the cmd.exe /c and the start command to make sure the default browser is executed when launching the URL. The URL is also specific to my lab environment and you need to adapt the URL to match your Sharepoint server and path. Keep an eye on the double-quotes and make sure they are all set correctly. Use a command prompt window to test and debug the command.
Replace sclab-sp with the host name of your SharePoint machine/farm.
Replace /kb with the path to your Enterprise Wiki Site.
With the $Name$ variable we pass in the alert name from the console.
Setup SharePoint Enterprise Wiki Site
As mentioned above, I’ve created an Enterprise Wiki Site. For demonstration purposes I’ve also created a new ContentType with an additional Column (Responsible Department) and also created a new template to display the new column on the Wiki page. You need to enable publishing on the site in order to create an Enterprise Wiki Site (click here for more information). The template will not be available if you do not enable it. I will not go into more details here as this is slightly out of scope – maybe I will dedicate a separate blog post about this if more people are interested. In any case, if you do not create a new content type or template, the stuff below will still work with all the defaults. I haven’t tested it but it should also work exactly the same way for standard Wiki Page libraries – even when using SharePoint Foundation.
Create and Setup the CustomRedirect.aspx Page
First things first: Let’s create the CustomRedirect.aspx page.
Open the Enterprise Wiki Site (Home.aspx – which is created by default). Click on Page, New and enter the name “CustomRedirect” (it’s important that you use the very same name you picked in the Alert Task above).
Once you are in edit mode on the CustomRedirect.aspx, insert a new Web Part and look for the Content Editor Web Part. Add the web part to the page.
You can go through the script and the comments. Essentially the script takes the alert name from the query string, forms some weird URL and executes the internal SharePoint function OpenPopUpPage. Luckily this function seems to only create a popup when the page you are trying to access doesn’t exist. If it does exist, it will just redirect you to the page. Perfect!
Now that everything is set up, let’s see how it looks like.
An operator selects an alert and clicks on the task to open the knowledge base:
The operator is presented with the custom redirect page if no KB entry is available for the selected alert:
After clicking the Create button you can start using the KB entry for this alert:
Two things to note here:
1. The name is pre-populated with the name of the alert.
2. At the very bottom you see the customization I made to the Wiki. I added a new choice column to specify the responsible department. Of course, many other useful things are possible here…
Once a KB entry for the selected alert exists., the operator will be redirected to that page immediately the next time he clicks on Open Knowledge Base:
As mentioned before, this is just a proof-of-concept and not really 100% production ready (I guess). I just want to show that there’s a good alternative when it comes to knowledge management. Using this tutorial/example as starting point should get you quickly up and running. It doesn’t hurt when you have a SharePoint guru around ; )
The files used in this example are available in this zip file.
Christoph Maresch used Media Wiki instead of SharePoint:
Robert commented that you can also use rundll in the task to open an URL in the default browser:
Params: url.dll,FileProtocolHandler http://scom-sp/kb/...