Class to provide the basic infrastructure for managing and tracking Alerts that occur in productions.
Parameter to control whether the pAction parameter passed to the
Update() is explicitly validated against the Ens.DataType.ManagedAlertActiondatatype. Users should override this setting if they extend this class and need to add their own actions. Note that InterSystems IRIS reserves all action values up to and including 512 (i.e. 2^9), so any user-defined actions should start with bit 10 (i.e. 1024).
The history of all previous actions that have been performed on this ManagedAlert.
The AlertGroups which should be used to determine where notifications should be sent.
The text of the original Alert.
The time the original Alert was triggered.
The name of the Business Partner associated with the source of the alert.
The user currently responsible for the ManagedAlert.
The escalation level of the ManagedAlert. This can be increased manually or be raised after no activity takes place within a user-defined period of time.
Flag to indicate whether the ManagedAlert is open or closed.
Calculated property to dynamically determine the last time an action occurred for this ManagedAlert.
The time before which an action should occur for this ManagedAlert.
The next time the Alert Monitor should check the status of this ManagedAlert. This is calculated automatically using the following logic:
- If a user is updating an alert, and doesn't change the
NextActionTime, no change will be made. (This ensures the monitor schedule is regular.)
NextActionTimeis in the future, then that time will be used.
NextActionTimeis in the past (i.e. an action is overdue), then the production's Alert Action Window setting will be used to calculate the time the Alert Monitor should check the ManagedAlert.
The name of the production in which the original Alert was triggered.
The session in which the Alert occurred.
The config item that triggered the original Alert.
Helper method to allow the individual values in AlertGroups to be indexed.
API to make it easier to mark some large set of managed alerts as closed. The arguments that control which specific alerts are closed are as follows:
- pErrors - flag to control whether the IDs that aren't removed are reported in subscripts of the pErrors variable on output. By default only the count is reported in pErrors.
- pDaysToKeep - flag to control the time window that should be closed using the same logic as purges. All managed alerts that occurred more than pDaysToKeep days in the past will be closed. The flag supports a value of -1 to ensure that ALL matching managed alerts are closed, including any that were created in the past day.
- pReason - A required string to indicate why the managed alerts are being closed.
- pConfigName - An optional string to specify that managed alerts from a specific SourceConfigName should be closed.
- pCurrentOwner - An optional string to specify that managed alerts assigned to the specified user should be closed. The default of -1 indicates no filter should be applied, as the empty string ("") is used to indicate that the managed alert is unassigned.
- pText - An optional string to filter the results by specific text. By default, the filter checks whether the AlertText property contains pText ignoring case. To use an equality filter, the first character of pText should be specified as "=", and the remainder of pText will be matched against the AlertText property.
NOTE: searches matching on AlertText may be very slow if no other filters are supplied.
Helper method to return a valid
NextMonitorTimevalue. If pNextActionTime is in the future, then pNextActionTime is returned. Otherwise, the production's Alert Action Window setting is used to calculate the next time.
Helper method to create a ManagedAlert based on the contents of an
Accessor method for
LastActionTimethat can be invoked from SQL. The method uses the same approach as LastActionTimeGet(), just in SQL.
Calculate the next action time for the Managed Alert.
Helper method to populate which values are available for display in the UI. The tree structure for pProperties should be as follows:
pProperties = $listbuild([names of properties])
pProperties([propName]) = $listbuild([Property Title],[Editable],[Action Value],[Datatype],[Empty Value],[Use Display Value])
The tree structure for pCollectionProperties is as follows:
pCollectionProperties = $listbuild([names of collection properties])
pCollectionProperties([collectionName]) = $listbuild([Collection Title],[Editable],[Action Value],[Instance Title],$listbuild([list of sub-properties to display]))
pCollectionProperties([collectionName],[propName]) = $listbuild([Property Title],[Editable],[Action Value],[Datatype],[Empty Value],[Use Display Value])
Accessor method for
LastActionTime. It simply gets the ActionTime from the most recent action in Actions, and the value of AlertTimeif no actions have been logged.
User callback invoked from
UpdateAlert() to allow users to specify extended action types and extra values.
Method to update a Managed Alert. The arguments are as follows:
- pAction - The bits indicating what actions should take place.
- pNewValues - An array of the new values to set subscripted by property name.
- pReason - A required string to indicate why the action is being taken.
Helper method to invoke
UpdateAlert() when the ManagedAlert instance is not already open.
Helper method to update the value of
NextMonitorTime. The code is in ComputeNextMonitorTime(), but the logic describing when UpdateNextMonitorTime() should be called and what value it should compute is in the documentation for the NextMonitorTimeproperty.
NextAction is on both NextActionTime and IsOpen as the UI needs to identify both of these fields as cheaply as possible.
NextMonitor is on both NextActionTime and IsOpen as the AlertMonitor component needs to identify these fields as cheaply as possible.