A Starter’s Guide To Developing Product Connectors
Ambrose Wong
ambrosew@microsoft.com
Microsoft Corporation
December 07
Table of Contents
Create An Application To
QUERY and Close Alerts
Install the Outbound
Connector
Appendix A: About
Knowledge Articles
Adding Your Own Company
Knowledge Article
Appendix B: Operations
Manager 2007 Command Shell
A connector is a custom service or program that allows System Center Operations Manager 2007 (SCOM) to communicate with external systems. For example, you can create a connector that sends Operations Manager alerts to an application that tracks the alerts. The application can use the connector to send an update to Operations Manager, indicating that the alert has been resolved.
You can develop a custom connector by using the Operations Manager Connector Framework (OMCF). The OMCF provides methods and types that you can use to initialize and manage a connector and to get or send operations data.
The following illustration shows the architecture of the SDK, and where OMCF positions.
As a quickstart guide, this document focuses on developing a sample outbound connector. You can easily use the same techniques to develop other types of SDK client applications.
In the diagram below, an outbound connector can send SCOM alerts to external systems for alert tracking. Alerts closed by external systems can update SCOM to reflect the change of alert state.
The samples in this document are developed and tested on the following platforms:
1. Windows Server 2003 Enterprise Edition 32-bit (x86) with SP2, Active Directory and Internet Information Services 6.0 enabled
2. System Center Operations Manager 2007
3. Microsoft Windows Server 2000/2003 Internet Information Services Management Pack
4. Visual Studio 2005 Team Suite with SP1
5. SQL Server 2005 Enterprise Edition with SP2
This section contains step-by-step instructions to produce a simulated outbound connector scenario where an outbound connector subscribes to and receives alerts. An accompanying application is used to close the alerts.
Note that the samples are implemented as simplified C# console applications. In real settings the connector is usually implemented as a service with more sophisticated error handling and event logging.
Also note the following:
1. The connector’s alert subscriptions can be administered through Operations Manager console to specify subscription groups, targets, and criteria. They can also be administered programmatically through Operations Manager SDK for more granular control.
2. Operations Manager polls for alerts every 30 seconds, and forwards the alerts to product connectors subscribed to the alerts. Each alert has a unique AlertId identifier.
3. The connector polls for alerts at a set interval (30 seconds in the sample). Once alerts are received, the connector can further forward them to external systems for processing.
4. The connector can optionally set an application specific TicketId values for the alert.
Create a C# console application called TestConn with the code below, with reference to the following assemblies under C:\Program Files\System Center Operations Manager 2007\SDK Binaries:
Microsoft.EnterpriseManagement.OperationsManager.dll
Microsoft.EnterpriseManagement.OperationsManager.Common.dll
using System;
using Microsoft.EnterpriseManagement;
using Microsoft.EnterpriseManagement.ConnectorFramework;
using Microsoft.EnterpriseManagement.Common;
using System.Collections.ObjectModel;
using System.Threading;
namespace OutboundConnector
{
class Program
{
static void Main(string[] args)
{
ManagementGroup mg = new ManagementGroup("localhost");
ConnectorFrameworkAdministration cfAdmin = mg.GetConnectorFrameworkAdministration();
Guid connectorGuid = new Guid("{6A1F8C0E-B8F1-4147-8C9B-5A2F98F10003}"); // Or create/use your own Guid.
MonitoringConnector connector;
try
{
if (args.Length == 1)
{
if (args[0] == "InstallConnector")
{
ConnectorInfo info = new ConnectorInfo();
info.Description = "Sample connector";
info.DisplayName = "Sample connector";
info.Name = "Sample connector";
connector = cfAdmin.Setup(info, connectorGuid);
connector.Initialize();
Console.WriteLine("Created {0} with ID: {1}", connector.Name, connector.Id);
}
else if (args[0] == "UninstallConnector")
{
connector = cfAdmin.GetMonitoringConnector(connectorGuid);
ReadOnlyCollection<MonitoringConnectorSubscription> subscriptions;
subscriptions = cfAdmin.GetConnectorSubscriptions();
foreach (MonitoringConnectorSubscription subscription in subscriptions)
{
if (subscription.MonitoringConnectorId == connectorGuid)
{
cfAdmin.DeleteConnectorSubscription(subscription);
}
}
connector.Uninitialize();
cfAdmin.Cleanup(connector);
Console.WriteLine("Connector removed.");
}
return;
}
connector = cfAdmin.GetMonitoringConnector(connectorGuid);
while (true)
{
ReadOnlyCollection<ConnectorMonitoringAlert> alerts;
alerts = connector.GetMonitoringAlerts();
if (alerts.Count > 0)
{
connector.AcknowledgeMonitoringAlerts(alerts);
}
int i = 1;
foreach (ConnectorMonitoringAlert alert in alerts)
{
//Send the alert to the other management system with the appropriate API
//from the other management system.
//Add a comment to the alert.
Console.WriteLine("#{0} Alert received on {1}", i.ToString(), DateTime.Now);
Console.WriteLine(">> Id: {0}", alert.Id.ToString());
Console.WriteLine(">> Category: {0}", alert.Category.ToString());
Console.WriteLine(">> ConnectorId: {0}", alert.ConnectorId.ToString());
Console.WriteLine(">> ConnectorStatus: {0}", alert.ConnectorStatus.ToString());
Console.WriteLine(">> RepeatCount: {0}", alert.RepeatCount.ToString());
Console.WriteLine(">> ResolutionState: {0}", alert.ResolutionState.ToString());
if (!string.IsNullOrEmpty(alert.ResolvedBy))
{
Console.WriteLine(">> ResolvedBy: {0}", alert.ResolvedBy.ToString());
}
Console.WriteLine(">> LastModified: {0}", alert.LastModified.ToString());
Console.WriteLine(">> LastModifiedByNonConnector: {0}", alert.LastModifiedByNonConnector.ToString());
Console.WriteLine(">> Priority: {0}", alert.Priority.ToString());
Console.WriteLine(">> Severity: {0}", alert.Severity.ToString());
Console.WriteLine(">> Description: {0}", alert.Description);
Console.WriteLine("");
i = i + 1;
}
//Wait for 30 sec before checking for new alerts again.
Console.WriteLine("Sleeping for 30 seconds...");
Thread.Sleep(30 * 1000);
}
}
catch (MonitoringException error)
{
Console.WriteLine(error.Message);
}
}
}
}
Create a C# console application called Alerts with the code below, with reference to the following assemblies under C:\Program Files\System Center Operations Manager 2007\SDK Binaries:
Microsoft.EnterpriseManagement.OperationsManager.dll
Microsoft.EnterpriseManagement.OperationsManager.Common.dll
using System;
using Microsoft.EnterpriseManagement;
using Microsoft.EnterpriseManagement.ConnectorFramework;
using Microsoft.EnterpriseManagement.Monitoring;
namespace Alerts
{
class Program
{
static void Main(string[] args)
{
if (args.Length != 2)
{
Console.WriteLine("Usage: alerts [get|set] [alertid]");
return;
}
string op = args[0].ToLower();
if ((op != "get") && (op != "set"))
{
Console.WriteLine("First parameter needs to be either 'get' or 'set'.");
return;
}
if (args[1].Length != 36)
{
Console.WriteLine("Second parameter needs to be an alert id guid in the format xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.");
return;
}
try
{
ManagementGroup mg = new ManagementGroup("localhost");
ConnectorFrameworkAdministration cfAdmin = mg.GetConnectorFrameworkAdministration();
MonitoringAlert alert = mg.GetMonitoringAlert(new Guid(args[1]));
ManagementPack mp;
if (alert.IsMonitorAlert)
{
mp = mg.GetMonitor(alert.ProblemId).GetManagementPack();
}
else
{
mp = mg.GetMonitoringRule(alert.MonitoringRuleId).GetManagementPack();
}
Console.WriteLine(">> Management Pack Id: {0}", mp.Id.ToString());
Console.WriteLine(">> Id: {0}", alert.Id.ToString());
Console.WriteLine(">> Category: {0}", alert.Category.ToString());
Console.WriteLine(">> ConnectorId: {0}", alert.ConnectorId.ToString());
Console.WriteLine(">> ConnectorStatus: {0}", alert.ConnectorStatus.ToString());
Console.WriteLine(">> RepeatCount: {0}", alert.RepeatCount.ToString());
Console.WriteLine(">> ResolutionState: {0}", alert.ResolutionState.ToString());
if (!string.IsNullOrEmpty(alert.ResolvedBy))
{
Console.WriteLine(">> ResolvedBy: {0}", alert.ResolvedBy.ToString());
}
Console.WriteLine(">> LastModified: {0}", alert.LastModified.ToString());
Console.WriteLine(">> LastModifiedByNonConnector: {0}", alert.LastModifiedByNonConnector.ToString());
Console.WriteLine(">> Priority: {0}", alert.Priority.ToString());
Console.WriteLine(">> Severity: {0}", alert.Severity.ToString());
Console.WriteLine(">> Description: {0}", alert.Description);
if (op == "set")
{
Console.WriteLine("Setting ResolutionState to 255.");
alert.ResolutionState = 255;
alert.Update("Alert closed.");
}
}
catch (Exception e)
{
Console.WriteLine(e.Message);
}
}
}
}
Run the following at the cmd prompt to install the outbound connector.
TestConn InstallConnector
In Operations Console, you should see the connector installed as "Sample connector".
Right-click on Sample connector and select Properties. You should see the Properties dialog box as shown below.
Click the "Add…" button to add a subscription for the connector.
In the General tab, put "Test" for both Subscription Name and Description.
In the Groups tab, select all groups.
In the Targets tab, select "Forward alerts from targets are automatically, including targets in Management Packs imported in the future."
In the Criteria tab, select the following:
· Error for Alerts of any of checked severity
· High, Medium, and Low for Priority
· New for Resolution State
· All items in Category
Click the Update button to save the changes. You should now see Test listed in the Subscriptions list.
Run the following at the cmd prompt to start polling for alerts every 30 seconds.
TestConn
Leave TestConn running and the cmd prompt window open.
Go to Internet Information Services (IIS) Manager from Administrative Tools, and stop the Default Web Site.
In Operations Console, go to Monitoring tab and select Active Alerts. After a short period you should see the alert about the stopped default web site.
At the cmd prompt where TestConn is running, you should see the same alert as received by the connector:
#1 Alert received on 12/14/2007 1:46:55 PM
>> Id: 3a07c24d-a13c-43b3-be44-f6cab6ecffb3
>> Category: PerformanceHealth
>> ConnectorId: 6a1f8c0e-b8f1-4147-8c9b-5a2f98f10003
>> ConnectorStatus: Pending
>> RepeatCount: 0
>> ResolutionState: 0
>> LastModified: 12/14/2007 5:46:19 AM
>> LastModifiedByNonConnector: 12/14/2007 5:46:19 AM
>> Priority: Low
>> Severity: Error
>> Description: The Internet Information Services Web Site named W3SVC/1 is unav
ailable as the site has been stopped.
In the OperationsManager database you can see the alert in the Alert table:
Note the AlertId and run the following command at the cmd prompt (substitute the alert id with the one in your environment).
alerts get 3a07c24d-a13c-43b3-be44-f6cab6ecffb3
You should see an output similar to the following:
>> Management Pack Id: 7a920be5-d53c-fa2d-07a8-b415265e95b0
>> Id: 3a07c24d-a13c-43b3-be44-f6cab6ecffb3
>> Category: PerformanceHealth
>> ConnectorId: 6a1f8c0e-b8f1-4147-8c9b-5a2f98f10003
>> ConnectorStatus: SuccessfullyForwarded
>> RepeatCount: 0
>> ResolutionState: 0
>> LastModified: 12/14/2007 5:46:19 AM
>> LastModifiedByNonConnector: 12/14/2007 5:46:19 AM
>> Priority: Low
>> Severity: Error
>> Description: The Internet Information Services Web Site named W3SVC/1 is unav
ailable as the site has been stopped.
Note that ConnectorStatus is SuccessfullyForwarded. ResolutionState is 0 (New).
Now run the following command at the cmd prompt to close the alert.
alerts set 3a07c24d-a13c-43b3-be44-f6cab6ecffb3
Run the following command at the cmd prompt to check the status again.
alerts get 3a07c24d-a13c-43b3-be44-f6cab6ecffb3
You should see an output similar to the following from the "get" operation:
>> Management Pack Id: 7a920be5-d53c-fa2d-07a8-b415265e95b0
>> Id: 3a07c24d-a13c-43b3-be44-f6cab6ecffb3
>> Category: PerformanceHealth
>> ConnectorId: 6a1f8c0e-b8f1-4147-8c9b-5a2f98f10003
>> ConnectorStatus: Pending
>> RepeatCount: 0
>> ResolutionState: 255
>> ResolvedBy: TESTDOMAIN\Administrator
>> LastModified: 12/14/2007 6:01:13 AM
>> LastModifiedByNonConnector: 12/14/2007 6:01:13 AM
>> Priority: Low
>> Severity: Error
>> Description: The Internet Information Services Web Site named W3SVC/1 is unav
ailable as the site has been stopped.
Note that ConnectorStatus is now Pending, with ResolutionState set to 255 (Closed) and ResolvedBy set to the credential that was used to connect to Operations Manager.
In the cmd prompt where TestConn is running, you should also see an output similar to the following notifying that the alert is closed:
#1 Alert received on 12/14/2007 2:02:02 PM
>> Id: 3a07c24d-a13c-43b3-be44-f6cab6ecffb3
>> Category: PerformanceHealth
>> ConnectorId: 6a1f8c0e-b8f1-4147-8c9b-5a2f98f10003
>> ConnectorStatus: Pending
>> RepeatCount: 0
>> ResolutionState: 255
>> ResolvedBy: TESTDOMAIN\Administrator
>> LastModified: 12/14/2007 6:01:13 AM
>> LastModifiedByNonConnector: 12/14/2007 6:01:13 AM
>> Priority: Low
>> Severity: Error
>> Description: The Internet Information Services Web Site named W3SVC/1 is unav
ailable as the site has been stopped.
Since the alert is closed, you should see the alert disappear from Operations Console’s Active Alerts list.
Run Alerts with "get" operation again, and you should see an output similar to the following:
>> Management Pack Id: 7a920be5-d53c-fa2d-07a8-b415265e95b0
>> Id: 3a07c24d-a13c-43b3-be44-f6cab6ecffb3
>> Category: PerformanceHealth
>> ConnectorId: 6a1f8c0e-b8f1-4147-8c9b-5a2f98f10003
>> ConnectorStatus: SuccessfullyForwarded
>> RepeatCount: 0
>> ResolutionState: 255
>> ResolvedBy: TESTDOMAIN\Administrator
>> LastModified: 12/14/2007 6:01:13 AM
>> LastModifiedByNonConnector: 12/14/2007 6:01:13 AM
>> Priority: Low
>> Severity: Error
>> Description: The Internet Information Services Web Site named W3SVC/1 is unav
ailable as the site has been stopped.
Note that the ConnectorStatus is now set to SuccessfullyForwarded, meaning the connector has successfully processed the notification.
The test scenario is now complete.
A product knowledge article is a knowledge article that resides in a sealed management pack. A company knowledge article resides in unsealed management pack.
Knowledge articles are tied to monitors or monitoring rules. Below is a sample code fragment that demonstrates how you can get all knowledge articles that tie to an alert’s monitor. For monitoring rules, use alert.MonitoringRuleId instead of alert.ProblemId.
ReadOnlyCollection<MonitoringKnowledgeArticle> kbs = mg.GetMonitoringKnowledgeArticles(alert.ProblemId);
foreach (MonitoringKnowledgeArticle kb in kbs)
{
Console.WriteLine("KB ID: {0}", kb.Id.ToString());
Console.WriteLine("KB ElementReference: {0}", kb.ElementReference.ToString());
Console.WriteLine("KB LanguageCode: {0}", kb.LanguageCode.ToString());
Console.WriteLine("KB Status: {0}", kb.Status.ToString());
Console.WriteLine("KB Visible: {0}", kb.Visible.ToString());
if (!string.IsNullOrEmpty(kb.MamlContent))
Console.WriteLine("KB MAML: {0}", kb.MamlContent.ToString());
if (!string.IsNullOrEmpty(kb.HtmlContent))
Console.WriteLine("KB HTML: {0}", kb.HtmlContent.ToString());
Console.WriteLine("MP ID: {0}", kb.GetManagementPack().Id.ToString());
Console.WriteLine("MP FriendlyName: {0}", kb.GetManagementPack().FriendlyName.ToString());
Console.WriteLine("MP DisplayName: {0}", kb.GetManagementPack().DisplayName.ToString());
Console.WriteLine("MP Name: {0}", kb.GetManagementPack().Name.ToString());
}
The output of the above code fragment shows the product knowledge article for the Default Web Site stopped alert from the sample outbound connector scenario.
KB ID: 6c4a6080-3fe1-1e9f-717c-15fb118c92d3
KB ElementReference: ManagementPackElementUniqueIdentifier=ce89d4d4-8264-8c51-5c
d9-a1ff0e314cdd
KB LanguageCode: ENU
KB Status: Unchanged
KB Visible: True
KB MAML: <maml:section xmlns:maml="http://schemas.microsoft.com/maml/2004/10"><m
aml:title>Summary</maml:title><maml:para>This monitor checks the status of the I
IS Web sites. If you receive an alert from this monitor, action is required in o
rder to bring the Web site back to an operational state.</maml:para><maml:para /
><maml:para>Operational States:</maml:para><maml:para>An IIS Web site can be eit
her in a "Running" or "Not Running" operational state.</maml:para><maml:para /><
/maml:section><maml:section xmlns:maml="http://schemas.microsoft.com/maml/2004/1
0"><maml:title>Causes</maml:title><maml:para>An IIS Web site can stop for many r
easons, including:</maml:para><maml:list><maml:listItem><maml:para>The Web site
was stopped by an administrator</maml:para></maml:listItem><maml:listItem><maml:
para>The Web site was stopped by IIS due to one or more errors that occured duri
ng run time.</maml:para></maml:listItem><maml:listItem><maml:para>The Web site w
as improperly configured which caused it to fail or prevented it from starting.<
/maml:para><maml:para /></maml:listItem></maml:list></maml:section><maml:section
xmlns:maml="http://schemas.microsoft.com/maml/2004/10"><maml:title>Resolutions<
/maml:title><maml:para>If an IIS Web site is "Not Running" you can diagnose the
issue or restart the site by taking the following actions:</maml:para><maml:list
><maml:listItem><maml:para>Check for additional Web site related alerts that mig
ht have occurred concurrently. These alerts might help better identify the reaso
n why the service entered a "Not Running" state.</maml:para></maml:listItem><mam
l:listItem><maml:para>Review the event logs on the managed computer, and correct
any underlying problems that might have caused the web site to stop unexpectedl
y.</maml:para></maml:listItem><maml:listItem><maml:para>Use the following Task t
o attempt to restart the Web Site.</maml:para><maml:para><maml:navigationLink><m
aml:linkText>Start IIS Web Site</maml:linkText><maml:uri condition="Task" href="
Microsoft.Windows.InternetInformationServices.2003.WebSite.StartWebSite.Task&
;tasktarget={$TARGET$}" uri="MOM.Console.Exe" /></maml:navigationLink></maml:par
a></maml:listItem></maml:list><maml:para /></maml:section><maml:section xmlns:ma
ml="http://schemas.microsoft.com/maml/2004/10"><maml:title>Configuration</maml:t
itle><maml:para>This monitor doesn't include any configuration settings that can
be modified.</maml:para><maml:para /></maml:section>
MP ID: 7a920be5-d53c-fa2d-07a8-b415265e95b0
MP FriendlyName: Windows Internet Information Services 2003
MP DisplayName: Windows Server Internet Information Services 2003
MP Name: Microsoft.Windows.InternetInformationServices.2003
Note that the GUID for the knowledge article’s ElementReference is the monitor or monitoring rule ID, which helps tie them together.
For many organizations, having company knowledge to accompany the monitor’s or monitoring rule’s alert is desirable to achieve operational excellence with System Center Operations Manager.
Company Knowledge article can be added through Operations Console:
As external system tracks alerts from Operations Manager, corresponding company-specific knowledge information about the monitor’s or monitoring rule’s alerts can be added.
Note:
You cannot modify knowledge articles that reside in sealed management pack. To add your company knowledge article, you need to save it in an unsealed management pack. Although there is a default management pack available, best practices dictate that you do not use the default management pack to store information such as company knowledge articles and overrides. You should create your own management packs to store such information.
To create a management pack, you can use Operations Console, go to Administration tab, right-click on Management Packs, and select Create Management Pack.
Once you created your unsealed management pack, you can use get-managementpack cmdlet to get the management pack’s ID. Below is a sample get-managementpack output for a management pack called Test Management Pack (refer to "Operations Manager 2007 Command Shell" for additional information).
>get-managementpack -name "Test.Management.Pack"
Name : Test.Management.Pack
TimeCreated : 1/4/2008 4:47:54 PM
LastModified : 1/4/2008 4:47:54 PM
KeyToken :
Version : 1.0.0.0
Id :
9ec718e3-f75b-bbb6-9707-e09d42569587
VersionId : f9d0700b-f34c-40ff-96dc-f890e69ddfa8
References : {Microsoft.SystemCenter.Library}
Sealed : False
ContentReadable : True
FriendlyName : Test Management Pack
DisplayName : Test Management Pack
Description : Test Management Pack
DefaultLanguageCode : ENU
LockObject : System.Object
Note the management pack ID.
Below is a sample code fragment that demonstrates how you can add your own company knowledge article to the Test Management Pack in response to an alert.
ManagementPackMonitor mon = mg.GetMonitor(alert.ProblemId);
ManagementPack mp = mg.GetManagementPack(new Guid("9ec718e3-f75b-bbb6-9707-e09d42569587"));
ManagementPackKnowledgeArticle newkb = new ManagementPackKnowledgeArticle(mon, "ENU", mp);
newkb.MamlContent = "<maml:section xmlns:maml=\"http://schemas.microsoft.com/maml/2004/10\"><maml:title>Summary</maml:title><maml:para>Sample Summary</maml:para></maml:section>";
mp.AcceptChanges();
The code fragment above stores MAML formatted knowledge article in MamlContent property. You can elect to store HTML formatted knowledge article in HtmlContent property:
newkb.HtmlContent = "<html><B>Summary</B><P>Sample Summary</P></html>";
However, note that you cannot edit the company knowledge article through Operations Console if your content is stored in HtmlContent property.
Throughout the test scenario described in this document, you can use Operations Manager 2007 cmdlets in the command shell to get additional information about various objects, including alerts, monitors, targets, management packs, etc.
You can start Operations Manager 2007 Command Shell by going to Start...All Programs…System Center Operations Manager 2007…Command Shell. The command shell script is Microsoft.EnterpriseManagement.OperationsManager.ClientShell.Startup.ps1 in the installation folder.
Below is a Operations Manager 2007 Command Shell prompt.
You can get alert details by using get-alert cmdlet and the alert id from the connector.
For the following output from the sample connector:
#1 Alert received on 12/27/2007 7:04:55 AM
>> Id: 11f18e2a-1aa0-4adc-a2f8-69d216ac1e60
>> Category: PerformanceHealth
>> ConnectorId: 6a1f8c0e-b8f1-4147-8c9b-5a2f98f10003
>> ConnectorStatus: Pending
>> RepeatCount: 0
>> ResolutionState: 0
>> LastModified: 12/27/2007 7:05:16 AM
>> LastModifiedByNonConnector: 12/27/2007 7:05:16 AM
>> Priority: Low
>> Severity: Error
>> Description: The Internet Information Services Web Site named W3SVC/1 is unav
ailable as the site has been stopped.
Note the Id value, and use get-alert cmdlet to get detailed information regarding the alert:
>get-alert -id 11f18e2a-1aa0-4adc-a2f8-69d216ac1e60
Id : 11f18e2a-1aa0-4adc-a2f8-69d216ac1e60
Name : Microsoft Windows Internet Information Servic
es 2003 Web Site is Unavailable.
Description : The Internet Information Services Web Site na
med W3SVC/1 is unavailable as the site has be
en stopped.
MonitoringObjectId : 6aaa027f-2915-8021-e2bf-3ff0b5eec611
MonitoringClassId : 648f8c95-dd28-84dd-dc64-eb08ee364d32
MonitoringObjectDisplayName : Default Web Site
MonitoringObjectName : W3SVC/1
MonitoringObjectPath : vpc-w03.testdomain.com
MonitoringObjectFullName : Microsoft.Windows.InternetInformationServices
.2003.WebSite:vpc-w03.testdomain.com;W3SVC/1
IsMonitorAlert : True
ProblemId : ce89d4d4-8264-8c51-5cd9-a1ff0e314cdd
MonitoringRuleId : ce89d4d4-8264-8c51-5cd9-a1ff0e314cdd
ResolutionState : 0
Priority : Low
Severity : Error
Category : PerformanceHealth
Owner :
ResolvedBy :
TimeRaised : 12/27/2007 7:04:55 AM
TimeAdded : 12/27/2007 7:04:56 AM
LastModified : 12/27/2007 7:05:16 AM
LastModifiedBy : Connector Framework Alert Write Action
TimeResolved :
TimeResolutionStateLastModified : 12/27/2007 7:04:55 AM
CustomField1 :
CustomField2 :
CustomField3 :
CustomField4 :
CustomField5 :
CustomField6 :
CustomField7 :
CustomField8 :
CustomField9 :
CustomField10 :
TicketId :
Context : <DataItem type="System.PropertyBagData" time=
"2007-12-27T15:04:55.9448448+08:00" sourceHea
lthServiceId="895BD899-3400-4077-5858-55B9DFA
805F8"><Property Name="W3SVC/1" VariantType="
19">4</Property></DataItem>
ConnectorId : 6a1f8c0e-b8f1-4147-8c9b-5a2f98f10003
LastModifiedByNonConnector : 12/27/2007 7:05:16 AM
MonitoringObjectInMaintenanceMode : False
MonitoringObjectHealthState : Error
ConnectorStatus : SuccessfullyForwarded
RepeatCount : 0
NetbiosComputerName : VPC-W03
NetbiosDomainName : TESTDOMAIN
PrincipalName : vpc-w03.testdomain.com
SiteName :
MaintenanceModeLastModified : 1/1/1900 12:00:00 AM
StateLastModified : 12/27/2007 7:04:55 AM
Parameters : {W3SVC/1}
ManagementGroup : TestOpsMgrGroup
ManagementGroupId : 063e1751-ae67-b39f-f191-ad32b6df5357
Note the following alert properties:
...
MonitoringObjectId : 6aaa027f-2915-8021-e2bf-3ff0b5eec611
MonitoringClassId : 648f8c95-dd28-84dd-dc64-eb08ee364d32
...
IsMonitorAlert : True
ProblemId : ce89d4d4-8264-8c51-5cd9-a1ff0e314cdd
MonitoringRuleId : ce89d4d4-8264-8c51-5cd9-a1ff0e314cdd
...
You can use additional cmdlets to get more information about these properties.
MonitoringObjectId:
>get-monitoringobject -id 6aaa027f-2915-8021-e2bf-3ff0b5eec611
Id : 6aaa027f-2915-8021-e2bf-3ff0b5eec611
PathName : Microsoft.Windows.InternetInformationServices.2003.WebSite%003
avpc%002dw03.testdomain.com%003bW3SVC%002f1
DisplayName : Default Web Site
ManagementMode :
ManagementGroup : TestOpsMgrGroup
HealthState : Error
OperationalState :
MonitoringClassId:
>get-monitoringclass -id 648f8c95-dd28-84dd-dc64-eb08ee364d32
ManagementGroup : TestOpsMgrGroup
ManagementGroupId : 063e1751-ae67-b39f-f191-ad32b6df5357
Abstract : False
Base : ManagementPackElementUniqueIdentifier=294f206e-08aa-6dc1-1bd
7-a72ce272f365
Hosted : True
Singleton : False
PropertyCollection : {ApplicationPoolName, ApplicationPoolID}
XmlTag : ClassType
Accessibility : Public
Name : Microsoft.Windows.InternetInformationServices.2003.WebSite
Id : 648f8c95-dd28-84dd-dc64-eb08ee364d32
DisplayName : IIS 2003 Web Site
Description : All IIS Web sites that are running on the Windows 2003 versi
on of Internet Information Services (IIS).
LanguageCode : ENU
Comment :
Status : Unchanged
LastModified : 11/21/2007 4:23:13 PM
TimeAdded : 11/21/2007 4:23:13 PM
For the Base property value, you can use the same get-monitoringclass cmdlet.
If IsMonitorAlert is True, ProblemId contains the ID of the corresponding monitor. Otherwise MonitoringRuleId contains the ID of the corresponding monitoring rule.
In the Default Web Site stopped scenario, IsMonitorAlert is True, so ProblemId contains the ID of the monitor.
>get-monitor -criteria:"Id='ce89d4d4-8264-8c51-5cd9-a1ff0e314cdd'"
ManagementGroup : TestOpsMgrGroup
ManagementGroupId : 063e1751-ae67-b39f-f191-ad32b6df5357
HasNonCategoryOverride : False
TypeID : ManagementPackElementUniqueIdentifier=dfc7fdae-1e87-
3667-8460-c2a258859f5f
ConfirmDelivery : False
OperationalStateCollection : {Good, Bad}
Configuration : <PeriodInSeconds>60</PeriodInSeconds><SiteID>$Target
/Property[Type="IISCommon!Microsoft.Windows.Internet
InformationServices.WebSite"]/SiteID$</SiteID>
XmlTag : UnitMonitor
Enabled : onEssentialMonitoring
Target : ManagementPackElementUniqueIdentifier=648f8c95-dd28-
84dd-dc64-eb08ee364d32
ParentMonitorID : ManagementPackElementUniqueIdentifier=a6c69968-61aa-
a6b9-db6e-83a0da6110ea
Remotable : True
Priority : Normal
RunAs :
Category : PerformanceHealth
AlertSettings : Microsoft.EnterpriseManagement.Configuration.Managem
entPackMonitorAlertSettings
Accessibility : Public
Name : Microsoft.Windows.InternetInformationServices.2003.W
ebSite.WebSiteStatusCheck.Monitor
Id : ce89d4d4-8264-8c51-5cd9-a1ff0e314cdd
DisplayName : A Windows Internet Information Service Web Site is U
navailable.
Description :
LanguageCode : ENU
Comment :
Status : Unchanged
LastModified : 11/21/2007 4:23:13 PM
TimeAdded : 11/21/2007 4:23:26 PM
Note that for the get-monitor cmdlet above, the "Id" for criteria is case sensitive.
The TypeID perperty value contains the ID for the monitor’s type. In this case, this is a UnitMonitor as see from the XmlTag property value.
For the Target GUID, you can use get-monitoringclass cmdlet.
For the ParentMonitorID GUID, you can use get-monitor cmdlet.
If IsMonitorAlert is False, the alert is from a monitoring rule, in which case the MonitoringRuleId contains the ID of the monitoring rule.
Instead of stopping the Default Web Site in the test scenario, you can try stopping the OpsMgr Health Service. The resulting alert from TestConn will be similar to below:
#1 Alert received on 12/30/2007 12:58:56 AM
>> Id:
45572286-77a9-40ba-9ec1-024d02d721e9
>> Category: Alert
>> ConnectorId: 6a1f8c0e-b8f1-4147-8c9b-5a2f98f10003
>> ConnectorStatus: Pending
>> RepeatCount: 0
>> ResolutionState: 0
>> LastModified: 12/29/2007 1:42:44 PM
>> LastModifiedByNonConnector: 12/29/2007 1:42:44 PM
>> Priority: Normal
>> Severity: Error
>> Description: The root health service (Healthservice) has either stopped or pa
used soon after Sat, 29 Dec 2007 13:39:50 GMT. This adversly affects all availab
ility calculation for the entire management group.
Run the get-alert cmdlet with the alert ID:
>get-alert -id 45572286-77a9-40ba-9ec1-024d02d721e9
Id : 45572286-77a9-40ba-9ec1-024d02d721e9
Name : Root Health Service stopped.
Description : The root health service (Healthservice) has e
ither stopped or paused soon after Sat, 29 De
c 2007 13:39:50 GMT. This adversly affects al
l availability calculation for the entire man
agement group.
MonitoringObjectId : 895bd899-3400-4077-5858-55b9dfa805f8
MonitoringClassId : ab4c891f-3359-3fb6-0704-075fbfe36710
MonitoringObjectDisplayName : vpc-w03.testdomain.com
MonitoringObjectName :
MonitoringObjectPath : vpc-w03.testdomain.com
MonitoringObjectFullName : Microsoft.SystemCenter.HealthService:vpc-w03.
testdomain.com
IsMonitorAlert : False
ProblemId : a1297c9f-b5bc-e817-ec77-cc246008d2af
MonitoringRuleId :
a1297c9f-b5bc-e817-ec77-cc246008d2af
ResolutionState : 0
Priority : Normal
Severity : Error
Category : Alert
Owner :
ResolvedBy :
TimeRaised : 12/29/2007 1:41:57 PM
TimeAdded : 12/29/2007 1:41:57 PM
LastModified : 12/29/2007 1:42:44 PM
LastModifiedBy : Connector Framework Alert Write Action
TimeResolved :
TimeResolutionStateLastModified : 12/29/2007 1:41:57 PM
CustomField1 :
CustomField2 :
CustomField3 :
CustomField4 :
CustomField5 :
CustomField6 :
CustomField7 :
CustomField8 :
CustomField9 :
CustomField10 :
TicketId :
Context :
ConnectorId : 6a1f8c0e-b8f1-4147-8c9b-5a2f98f10003
LastModifiedByNonConnector : 12/29/2007 1:42:44 PM
MonitoringObjectInMaintenanceMode : False
MonitoringObjectHealthState : Success
ConnectorStatus : SuccessfullyForwarded
RepeatCount : 0
NetbiosComputerName : VPC-W03
NetbiosDomainName : TESTDOMAIN
PrincipalName : vpc-w03.testdomain.com
SiteName :
MaintenanceModeLastModified : 1/1/1900 12:00:00 AM
StateLastModified : 12/29/2007 1:33:02 AM
Parameters : {}
ManagementGroup : TestOpsMgrGroup
ManagementGroupId : 063e1751-ae67-b39f-f191-ad32b6df5357
In this case IsMonitorAlert is False. You can use get-rule cmdlet with the MonitoringRuleId to get more information about the monitoring rule:
>get-rule -id a1297c9f-b5bc-e817-ec77-cc246008d2af
ManagementGroup : TestOpsMgrGroup
ManagementGroupId : 063e1751-ae67-b39f-f191-ad32b6df5357
HasNonCategoryOverride : False
Enabled : true
Target : ManagementPackElementUniqueIdentifier=9189a49e-b2de-cab0
-2e4f-4925b68e335d
ConfirmDelivery : True
Remotable : True
Priority : Normal
DiscardLevel : 100
Category : Alert
ConditionDetection :
DataSourceCollection : {EventDS}
WriteActionCollection : {GenerateAlert}
XmlTag : Rule
Name : Microsoft.SystemCenter.SDKService.PrincipleManagementSer
verDown.Alert
Id : a1297c9f-b5bc-e817-ec77-cc246008d2af
DisplayName : Root Management Server Unavailable
Description : Alert generating rule for when the Root Management Serve
r is not reachable from this Management Servers SDK serv
ice.
LanguageCode : ENU
Comment :
Status : Unchanged
LastModified : 11/21/2007 3:54:25 PM
TimeAdded : 11/21/2007 3:54:28 PM
To get the an alert’s corresponding management pack, notice the Management Pack ID from the Alerts sample output:
>> Management
Pack Id: 7a920be5-d53c-fa2d-07a8-b415265e95b0
>> Id: 3a07c24d-a13c-43b3-be44-f6cab6ecffb3
>> Category: PerformanceHealth
>> ConnectorId: 6a1f8c0e-b8f1-4147-8c9b-5a2f98f10003
>> ConnectorStatus: SuccessfullyForwarded
>> RepeatCount: 0
>> ResolutionState: 0
>> LastModified: 12/14/2007 5:46:19 AM
>> LastModifiedByNonConnector: 12/14/2007 5:46:19 AM
>> Priority: Low
>> Severity: Error
>> Description: The Internet Information Services Web Site named W3SVC/1 is unav
ailable as the site has been stopped.
You can use get-managementpack cmdlet with the ID to get more information about the management pack:
>get-managementpack -id 7a920be5-d53c-fa2d-07a8-b415265e95b0
Name : Microsoft.Windows.InternetInformationServices.2003
TimeCreated : 11/21/2007 4:23:13 PM
LastModified : 11/21/2007 4:23:13 PM
KeyToken : 31bf3856ad364e35
Version : 6.0.5000.0
Id : 7a920be5-d53c-fa2d-07a8-b415265e95b0
VersionId : 5c1a10e7-8776-44fc-5713-6f462352ebe8
References : {Microsoft.SystemCenter.DataWarehouse.Library, Microsoft.Wi
ndows.InternetInformationServices.CommonLibrary, Microsoft.
Windows.Library, System.Performance.Library...}
Sealed : True
ContentReadable : True
FriendlyName : Windows Internet Information Services 2003
DisplayName : Windows Server Internet Information Services 2003
Description : Microsoft Windows Server Internet Information Services 2003
Management Pack: This management pack discovers and monito
rs Windows Server Internet Information Services 2003.
DefaultLanguageCode : ENU
LockObject : System.Object
System Center Operations Manager 2007 SDK
How to Create Outbound Connectors
Microsoft Windows Server 2000/2003 Internet Information Services Management Pack
Microsoft Windows Internet Information Services Management Pack Guide
Operations Manager Product Team Blog
Notes on System Center Operations Manager
System Center Operations Manager Command Shell
Look for microsoft.public.opsmgr newsgroups on http://www.microsoft.com/communities/newsgroups/list/en-us/default.aspx
<><><>