次の方法で共有


MonitoringConnectorSubscription Class

[This topic is pre-release documentation and is subject to change in future releases. Blank topics are included as placeholders.]

Represents a monitoring connector subscription.

Namespace: Microsoft.EnterpriseManagement.ConnectorFramework
Assembly: Microsoft.EnterpriseManagement.OperationsManager (in Microsoft.EnterpriseManagement.OperationsManager.dll)

Usage

'Usage
Dim instance As MonitoringConnectorSubscription

Syntax

'Declaration
<SerializableAttribute> _
Public Class MonitoringConnectorSubscription
    Inherits CreatableMonitoringBaseWithId
[SerializableAttribute] 
public class MonitoringConnectorSubscription : CreatableMonitoringBaseWithId
[SerializableAttribute] 
public ref class MonitoringConnectorSubscription : public CreatableMonitoringBaseWithId
/** @attribute SerializableAttribute() */ 
public class MonitoringConnectorSubscription extends CreatableMonitoringBaseWithId
SerializableAttribute 
public class MonitoringConnectorSubscription extends CreatableMonitoringBaseWithId

Example

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);
        }
    }
}

Remarks

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.

Inheritance Hierarchy

System.Object
   Microsoft.EnterpriseManagement.Common.MonitoringBase
     Microsoft.EnterpriseManagement.Common.CreatableMonitoringBaseWithId
      Microsoft.EnterpriseManagement.ConnectorFramework.MonitoringConnectorSubscription

Thread Safety

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

Platforms

Development Platforms

Windows Vista, Windows Server 2003, and

Target Platforms

Change History

See Also

Reference

MonitoringConnectorSubscription Members
Microsoft.EnterpriseManagement.ConnectorFramework Namespace