MonitoringConnectorSubscription Class

Updated: April 16, 2012

Represents a monitoring connector subscription. Namespace: Microsoft.EnterpriseManagement.ConnectorFramework
Assembly: Microsoft.EnterpriseManagement.OperationsManager (in Microsoft.EnterpriseManagement.OperationsManager.dll)Dim instance As MonitoringConnectorSubscription <SerializableAttribute> _ Public Class MonitoringConnectorSubscription Inherits CreatableMonitoringBaseWithId[SerializableAttribute] public class MonitoringConnectorSubscription : CreatableMonitoringBaseWithId[SerializableAttribute] public ref class MonitoringConnectorSubscription : public CreatableMonitoringBaseWithId/** @attribute SerializableAttribute() */ public class MonitoringConnectorSubscription extends CreatableMonitoringBaseWithIdSerializableAttribute public class MonitoringConnectorSubscription extends CreatableMonitoringBaseWithId

The following example assumes there is at least one connector created in the Operations Manager. The example gets the first connector and adds a subscription to that connector.

using System;
using System.Collections.ObjectModel;
using System.Text;
using System.Collections.Generic;
using Microsoft.EnterpriseManagement;
using Microsoft.EnterpriseManagement.Administration;
using Microsoft.EnterpriseManagement.Monitoring;
using Microsoft.EnterpriseManagement.ConnectorFramework;
using Microsoft.EnterpriseManagement.Common;
using Microsoft.EnterpriseManagement.Configuration;

namespace ConnectorSample
{
	class Program
	{
		static void Main(string[] args)
		{
			// Connect to a management group
			ManagementGroup mgmtGroup = new ManagementGroup("localhost");
		 
			// Get the first connector. The subscription will be to this object.
			IList<MonitoringConnector> connectors = mgmtGroup.ConnectorFramework.GetConnectors();
			MonitoringConnector connector = connectors[0];
			// Create a subscription
			AlertNotChangedSubscriptionConfiguration config = new AlertNotChangedSubscriptionConfiguration(AlertSubscriptionConfigurationType.Any);
			config.Criteria = "<SimpleExpression><ValueExpression><Property>ResolutionState</Property></ValueExpression><Operator>Equal</Operator><ValueExpression><Value>255</Value></ValueExpression></SimpleExpression>";
			MonitoringConnectorSubscription subscription = new MonitoringConnectorSubscription("AlertSubscription", connector.Id, config);
			subscription.DisplayName = "Alerts Subscription";
			subscription.Description = "Alerts Subscription Description";
			mgmtGroup.ConnectorFramework.InsertConnectorSubscription(subscription);
	}
}
}

For more information about connectors, see Connecting to External Systems by Using Operations Manager Connectors. Monitoring connectors subscribe to alerts and forwards them to other products. A connector must have a subscription to allow alerts to pass.

A subscription can be seen in the Operations Manager. In the Administration pane select the Product Connectors, and right-click a specific Product Connector to access its properties. You can view a subscription by selecting the specific subscription and clicking Edit.



  
    
      Microsoft.EnterpriseManagement.ConnectorFramework.MonitoringConnectorSubscription
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Development Platforms

Windows Vista, Windows Server 2003, and

Target Platforms