Share via


MonitoringConnector.GetMonitoringAlerts Method

Definition

Gets alerts marked for the monitoring connector.

Overloads

GetMonitoringAlerts()

Gets all the alerts that are currently pending for this connector.

GetMonitoringAlerts(DateTime)

Gets all the alerts that would be pending for the given connector, given the bookmark.

GetMonitoringAlerts(Int32)

Gets all the alerts that are currently pending for this connector.

GetMonitoringAlerts(DateTime, Int32)

Gets all the alerts that would be pending for the given connector, given the bookmark.

Remarks

To get a MonitoringAlert collection through a MonitoringConnector:

  1. The monitoring connector must be set up.

  2. The monitoring connector must be initialized.

  3. Alerts must be present.

  4. Alerts must be marked for the monitoring connector.

GetMonitoringAlerts()

Gets all the alerts that are currently pending for this connector.

public:
 System::Collections::ObjectModel::ReadOnlyCollection<Microsoft::EnterpriseManagement::ConnectorFramework::ConnectorMonitoringAlert ^> ^ GetMonitoringAlerts();
public System.Collections.ObjectModel.ReadOnlyCollection<Microsoft.EnterpriseManagement.ConnectorFramework.ConnectorMonitoringAlert> GetMonitoringAlerts ();
member this.GetMonitoringAlerts : unit -> System.Collections.ObjectModel.ReadOnlyCollection<Microsoft.EnterpriseManagement.ConnectorFramework.ConnectorMonitoringAlert>
Public Function GetMonitoringAlerts () As ReadOnlyCollection(Of ConnectorMonitoringAlert)

Returns

The alerts currently pending for this connector.

Examples

The following example uses the GetMonitoringAlerts method to get the first alert that is marked for this connector and display that alert.

This example assumes that a monitoring connector exists and that alerts are marked for this connector.

Remarks

This method only gets alerts that are marked for the monitoring connector from the bookmark time to the current time less 30 seconds.

See also

Applies to

GetMonitoringAlerts(DateTime)

Gets all the alerts that would be pending for the given connector, given the bookmark.

public:
 System::Collections::ObjectModel::ReadOnlyCollection<Microsoft::EnterpriseManagement::ConnectorFramework::ConnectorMonitoringAlert ^> ^ GetMonitoringAlerts(DateTime utcBookmarkTime);
public System.Collections.ObjectModel.ReadOnlyCollection<Microsoft.EnterpriseManagement.ConnectorFramework.ConnectorMonitoringAlert> GetMonitoringAlerts (DateTime utcBookmarkTime);
member this.GetMonitoringAlerts : DateTime -> System.Collections.ObjectModel.ReadOnlyCollection<Microsoft.EnterpriseManagement.ConnectorFramework.ConnectorMonitoringAlert>
Public Function GetMonitoringAlerts (utcBookmarkTime As DateTime) As ReadOnlyCollection(Of ConnectorMonitoringAlert)

Parameters

utcBookmarkTime
DateTime

The utc bookmark.

Returns

The alerts with the given bookmark applied.

Remarks

This method only gets alerts that are marked for the monitoring connector from the utcBookmarkTime bookmark time to the current time less 30 seconds.

Applies to

GetMonitoringAlerts(Int32)

Gets all the alerts that are currently pending for this connector.

public:
 System::Collections::ObjectModel::ReadOnlyCollection<Microsoft::EnterpriseManagement::ConnectorFramework::ConnectorMonitoringAlert ^> ^ GetMonitoringAlerts(int batchSize);
public System.Collections.ObjectModel.ReadOnlyCollection<Microsoft.EnterpriseManagement.ConnectorFramework.ConnectorMonitoringAlert> GetMonitoringAlerts (int batchSize);
member this.GetMonitoringAlerts : int -> System.Collections.ObjectModel.ReadOnlyCollection<Microsoft.EnterpriseManagement.ConnectorFramework.ConnectorMonitoringAlert>
Public Function GetMonitoringAlerts (batchSize As Integer) As ReadOnlyCollection(Of ConnectorMonitoringAlert)

Parameters

batchSize
Int32

The approximate max batch size to return.

Returns

The alerts currently pending for this connector.

Examples

The following example uses the GetMonitoringAlerts method to get the first alert that is marked for this connector and display that alert. Then it repeats the same operation except that it gets the array in batches.

This example assumes that a monitoring connector exists and that alerts are marked for this connector.

Remarks

This method will only retrieve up to the number of alerts that are specified by the batchSize parameter. This limitation allows you to perform the get monitoring alerts operation in small batches, thereby avoiding a time-out failure.

This method only gets alerts that are marked for the monitoring connector from the bookmark time to the current time less 30 seconds.

It is good practice to limit the number of alerts obtained by a single call. When you perform this GetMonitoringAlerts method you should check to see if the count property of the returned collection equals or exceeds the batchSize. If the count property of the returned collection equals or exceeds the batchSize then you should acknowledge the alerts received, and call this function again to get the next batch of alerts. Only when the returned collection is smaller than the batchSize can you be sure that you have received all of the alerts.

After you retrieve the monitoring alert, you need to acknowledge that alert with an AcknowledgeMonitoringAlerts or one of the overloaded methods. Failure to acknowledge an alert will result in subsequent calls to get new alerts returning the already received alerts.

This method only gets alerts that are marked for the monitoring connector from the bookmark time to the current time less 30 seconds.

Applies to

GetMonitoringAlerts(DateTime, Int32)

Gets all the alerts that would be pending for the given connector, given the bookmark.

public:
 System::Collections::ObjectModel::ReadOnlyCollection<Microsoft::EnterpriseManagement::ConnectorFramework::ConnectorMonitoringAlert ^> ^ GetMonitoringAlerts(DateTime utcBookmarkTime, int batchSize);
public System.Collections.ObjectModel.ReadOnlyCollection<Microsoft.EnterpriseManagement.ConnectorFramework.ConnectorMonitoringAlert> GetMonitoringAlerts (DateTime utcBookmarkTime, int batchSize);
member this.GetMonitoringAlerts : DateTime * int -> System.Collections.ObjectModel.ReadOnlyCollection<Microsoft.EnterpriseManagement.ConnectorFramework.ConnectorMonitoringAlert>
Public Function GetMonitoringAlerts (utcBookmarkTime As DateTime, batchSize As Integer) As ReadOnlyCollection(Of ConnectorMonitoringAlert)

Parameters

utcBookmarkTime
DateTime

The utc bookmark.

batchSize
Int32

The approximate max batch size to return.

Returns

The alerts with the given bookmark applied.

Remarks

This method will only retrieve up to the number of alerts that are specified by the batchSize parameter. This limitation allows you to perform the get monitoring alerts operation in small batches, thereby avoiding a time-out failure.

This method only gets alerts that are marked for the monitoring connector from the bookmark time to the current time less 30 seconds.

It is good practice to limit the number of alerts obtained by a single call. When you perform this GetMonitoringAlerts method you should check to see if the count property of the returned collection equals or exceeds the batchSize. If the count property of the returned collection equals or exceeds the batchSize then you should acknowledge the alerts received, and call this function again to get the next batch of alerts. Only when the returned collection is smaller than the batchSize can you be sure that you have received all of the alerts.

After you retrieve the monitoring alert, you need to acknowledge that alert with an AcknowledgeMonitoringAlerts or one of the overloaded methods. Failure to acknowledge an alert will result in subsequent calls to get new alerts returning the already received alerts.

This method only gets alerts that are marked for the monitoring connector from the bookmark time to the current time less 30 seconds.

Applies to