Assembly: Microsoft.EnterpriseManagement.OperationsManager (in microsoft.enterprisemanagement.operationsmanager.dll)
Usage
Visual Basic |
---|
Dim instance As ConnectorMonitoringAlert |
Syntax
Visual Basic |
---|
<SerializableAttribute> _ Public Class ConnectorMonitoringAlert Inherits MonitoringAlert |
C# |
---|
[SerializableAttribute] public class ConnectorMonitoringAlert : MonitoringAlert |
C++ |
---|
[SerializableAttribute] public ref class ConnectorMonitoringAlert : public MonitoringAlert |
J# |
---|
/** @attribute SerializableAttribute() */ public class ConnectorMonitoringAlert extends MonitoringAlert |
JScript |
---|
SerializableAttribute public class ConnectorMonitoringAlert extends MonitoringAlert |
Example
The following example retrieves all of the alerts subscribed to a specific connector and displays a few of the ConnectorMonitoringAlert properties, including the ManagementGroupId and the ManagementGroupName.
This example assumes that a monitoring connector exists and that alerts are marked for this connector.
C# | Copy Code |
---|---|
using System; using System.Collections.ObjectModel; using System.Text; using Microsoft.EnterpriseManagement; 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"); // Gets a reference to the connector framework administration object. ConnectorFrameworkAdministration cfAdmin = mgmtGroup.GetConnectorFrameworkAdministration(); // Get a collection of all connectors ReadOnlyCollection<MonitoringConnector> connectors = cfAdmin.GetMonitoringConnectors(); Console.WriteLine("There are " + connectors.Count + " connectors"); // Get the alerts of the first connector MonitoringConnector connector = connectors[0]; ReadOnlyCollection<ConnectorMonitoringAlert> alerts = connector.GetMonitoringAlerts(); if (alerts.Count > 0) { Console.WriteLine("There are " + alerts.Count + " alerts subscribed to by " + connector.Name); // Get information for the first alert ConnectorMonitoringAlert alert = alerts[0]; Console.WriteLine("\nAlert Name: " + alert.Name); Console.WriteLine(" Management group: " + alert.ManagementGroupName); Console.WriteLine(" ManagementGroupId: " + alert.ManagementGroupId); Console.WriteLine(" Raised: " + alert.TimeRaised); Console.WriteLine(" Has been repeated: " + alert.RepeatCount + " times."); Console.WriteLine(" Resolution state: " + (SystemMonitoringAlertResolutionState)alert.ResolutionState); Console.WriteLine(" Severity: " + alert.Severity.ToString()); } } } } |
Inheritance Hierarchy
System.Object
Microsoft.EnterpriseManagement.Common.MonitoringBase
Microsoft.EnterpriseManagement.Monitoring.OperationalDataObject
Microsoft.EnterpriseManagement.Monitoring.MonitoringAlert
Microsoft.EnterpriseManagement.ConnectorFramework.ConnectorMonitoringAlert
Microsoft.EnterpriseManagement.Common.MonitoringBase
Microsoft.EnterpriseManagement.Monitoring.OperationalDataObject
Microsoft.EnterpriseManagement.Monitoring.MonitoringAlert
Microsoft.EnterpriseManagement.ConnectorFramework.ConnectorMonitoringAlert
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.