Export (0) Print
Expand All

How to Create a Knowledge Article

System Center

Updated: May 22, 2009

Applies To: Operations Manager 2007 R2, Operations Manager 2007 SP1, System Center Operations Manager 2007

A knowledge article contains custom information aimed at helping a user of the Operations Manager Operations Console or the Web Console. Knowledge articles are added to a Management Pack, or an element of a Management pack such as a monitor, a discovery object, or a rule, by using the ManagementPackKnowledgeArticle class. The knowledge article is written in HTML, and it can contain specific information about the element or Management Pack that it is associated with.

The following code example creates a knowledge article for a rule.

Imports System
Imports System.Collections.Generic
Imports System.Text
Imports Microsoft.EnterpriseManagement
Imports Microsoft.EnterpriseManagement.Configuration
Imports System.Collections.ObjectModel


Namespace SDKSamples
    Class Program

        Public Overloads Shared Function Main(ByVal args() As String) As Integer

            Dim mg As New ManagementGroup("localhost")
            Dim defaultMP As ManagementPack = mg.GetManagementPacks("Microsoft.SystemCenter.OperationsManager.DefaultUser")(0)

            Dim ruleCriteria As New MonitoringRuleCriteria("DisplayName = 'SQL User Connections'")

            Dim rule As MonitoringRule = Nothing
            Try
                rule = mg.GetMonitoringRules(ruleCriteria)(0)
            Catch e As System.ArgumentOutOfRangeException

                Console.WriteLine("Error: Could not retrieve the specified rule.")
                Return 1
            End Try

            Dim article As New ManagementPackKnowledgeArticle(rule, "ENU", defaultMP)
            article.HtmlContent = "<html><body>This is a placeholder for a knowledge article</body></html>"

            defaultMP.AcceptChanges()
        End Function 'Main
    End Class 'Program
End Namespace 'SDKSamples

Show:
© 2014 Microsoft