Events and Alerts Maintenance

Version 6

    Verified Product Versions

    AppSense Management Center 10.1

    Introduction

     

    Management Server 10.1 FR2 has introduced a number of new PowerShell commandlets which allow administrators to easily manage the number of events which are stored in the Management Server database. The commandlets provide a number of ways for the administrator to target different selections of events and alerts based on factors such as age of events, event ID (or event ID range), Deployment Group or 'High Volume' property.

     

    Detail

     

    To allow the administrator to understand the effect of a particular operation, each commandlet has a 'preview' commandlet associated with it. Each preview commandlet can be identified by its prefix "Test-", whereas each actual deletion operation commandlet has an "Invoke-" prefix.

     

    Depending on the number of events held in a Management Server database, the commandlets could result in a high volume of deletes, meaning it could take a significant amount of time to execute a request. To avoid extended database locking, a batching mechanism has been built into the commandlets. This is controlled by parameters specified when the commandlet is invoked. The mechanism slices up the task into batches based on the optional batch size (number of rows to delete per batch) and batch interval (the duration of the interval between the batches that make up the operation) parameters. If these parameters are not supplied then built-in defaults are used.

     

    Below is a summary of each commandlet and an example of how it may be used.

     

    Invoke-AmcRemoveEventsOlderThan (Test-AmcRemoveEventsOlderThan)

     

    This command deletes the events that are older than the number of days specified. The following parameters may be passed:

     

         Days How many days' worth of events to retain - any events older than this will be deleted. Int

         BatchSize (Int) Number of rows to be affected within each batch transaction (Optional).

         BatchDelay (Int) Amount of time in seconds that SQL will pause to allow other transactions to process (so preventing transaction locks - Optional).

     

    Example

     

    PS C:\> Invoke-AmcRemoveEventsOlderThan -Days 2
    

     

    This command deletes events which are older than 2 days.

     

    Invoke-AmcRemoveEventsWithId (Test-AmcRemoveEventsWithId)

     

    This command deletes the events with the specified Id. The following parameters may be passed:

     

         EventId The event Id to be removed from the database. Int

         BatchSize (Int) Number of rows to be affected within each batch transaction (Optional).

         BatchDelay (Int) Amount of time in seconds that SQL will pause to allow other transactions to process (so preventing transaction locks - Optional).

     

    Example

     

    PS C:\> Invoke-AmcRemoveEventsWithId -EventId 9000
    

     

    This command deletes all events with Id 9000.

     

    Invoke-AmcRemoveEventsWithIdRange (Test-AmcRemoveEventsWithIdRange)

     

    This command deletes all events within an event Id range.  The following parameters may be passed:

     

         StartEventId The start event Id range to be removed from the database. Int

         EndEventId The end event Id range to be removed from the database. Int

         BatchSize (Int) Number of rows to be affected within each batch transaction (Optional).

         BatchDelay (Int) Amount of time in seconds that SQL will pause to allow other transactions to process (so preventing transaction locks - Optional).

     

    Example

     

    PS C:\> Invoke-AmcRemoveEventsWithIdRange -StartEventId 9000 -EndEventId 9099
    

     

    This command deletes the events with the range 9000 and 9099.

     

    Invoke-AmcRemoveHighVolumeEventsOlderThan (Test-AmcRemoveHighVolumeEventsOlderThan)

     

    This command deletes all high volume events older than the specified days.  The following parameters may be passed:

     

         Days The maximum age of high volume events that should be retained. Int

         BatchSize (Int) Number of rows to be affected within each batch transaction (Optional).

         BatchDelay (Int) Amount of time in seconds that SQL will pause to allow other transactions to process (so preventing transaction locks - Optional).

     

    Example

     

    PS C:\> Invoke-AmcRemoveHighVolumeEventsOlderThan -Days 2
    

     

    This command deletes all high volume events older than 2 days.

     

     

    Invoke-AmcRemoveOrphanedAlerts (Invoke-AmcRemoveOrphanedAlerts)

     

    This command deletes all alerts which do not have any associated events. The following parameters may be passed:

     

         BatchSize (Int) Number of rows to be affected within each batch transaction (Optional).

         BatchDelay (Int) Amount of time in seconds that SQL will pause to allow other transactions to process (so preventing transaction locks - Optional).

     

    Example

     

    PS C:\> Invoke-AmcRemoveOrphanedAlerts
    

     

    This command deletes all alerts which do not have any associated events.