Compartir a través de


MonitoringConnector.GetMonitoringAlerts Method (DateTime, Int32)

 

Applies To: Operations Manager for System Center 2012

Gets alerts marked for the monitoring connector. You also specify a timestamp bookmark, and all alerts with a timestamp after the bookmark will be returned. The retrieved array is limited to the batchSize parameter.

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

Syntax

public ReadOnlyCollection<ConnectorMonitoringAlert> GetMonitoringAlerts(
    DateTime utcBookmarkTime,
    int batchSize
)
public:
ReadOnlyCollection<ConnectorMonitoringAlert^>^ GetMonitoringAlerts(
    DateTime utcBookmarkTime,
    int batchSize
)
member GetMonitoringAlerts : 
        utcBookmarkTime:DateTime *
        batchSize:int -> ReadOnlyCollection<ConnectorMonitoringAlert>
Public Function GetMonitoringAlerts (
    utcBookmarkTime As Date,
    batchSize As Integer
) As ReadOnlyCollection(Of ConnectorMonitoringAlert)

Parameters

  • utcBookmarkTime
    Type: System.DateTime

    A timestamp bookmark. All alerts with a timestamp after this will be acknowledged.

  • batchSize
    Type: System.Int32

    The approximate max batch size to return.

Return Value

Type: System.Collections.ObjectModel.ReadOnlyCollection<ConnectorMonitoringAlert>

Returns a ReadOnlyCollection<T> of ConnectorMonitoringAlert objects that contain the alerts for the specified monitoring connector and have a bookmark time since the utcBookmarkTime value.

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.

See Also

GetMonitoringAlerts Overload
MonitoringConnector Class
Microsoft.EnterpriseManagement.ConnectorFramework Namespace

Return to top