Arbitrary Resource Operations as Alerts
Current situationCurrently it is only possible to execute operations on the resource, the alert was triggered on. This is not good for situations where e.g. the customer wants to reboot the JBossAS server when his application leaks too much memory, as the reboot action is on the AS resource, while the memory is on the VM resource. FutureIn the future, it will be possible to select a target resource or compatible group, the operation will be run on. The following UI shows this (the current UI has a Edit... button to enable selection of the operation). While the mock up shows the current tab-based layout, it is expected that the Operation sender will end up in the new alert plugin scheme with its updated UI. The existing Edit... button gets replaced by the following: Operations have a target selector that by default point to this resource (old behavior). When Other resource or Group are selected, the group marked in green is enabled and the user can press „Select..." to get a popup to search for a Resource or compatible group. The popup will (re)use the search boxes from the Resources/Group menu (and if possible also their favorites and last ... sections). After the user has made a selection, it is shown in the text field named „identifier". Resource SelectionRequirements
Option 1 - Custom Form (chosen solution)Use a custom form that gives a specific, constraint interface that allows each of the cases described above. Please select the Resource the Operation should be Executed on: [ ] Resource this Alert Fires On [ ] Resource Relative to the Resource this Alert Fires On Ancestor of this Resource: type: __(combobox)__ name: __(input)__ Descendant of Ancestor Specified Above, or of this Resource if Ancestor not Specified: type: __(combobox)__ name: __(input)__ [ ] Specific Resource (resource picker) Option 2 - DynaGroup-like DSL w/descendant search// find the Script resource with name *diag* // under the Platform resource relative // to the resource that triggered the alert hierarchy.start=Platform resource.type=Script resource.name.startswith=diag OR // find the Script resource with name *diag* // under the closet ancestor server relative // to the resource that triggered the alert hierarchy.start=Server resource.type=Script resource.name.startswith=diag OR // find the Script resource with name *diag* // under the great-grand-parent resource relative // to the resource that triggered the alert hierarchy.start=ancestor[3] resource.type=Script resource.name.startswith=diag Option 3 - DynaGroup-like DSL w/ancestor & descendant search// relative to the resource that triggered the alert, // look up the ancestry and find the JBossAS Server // then from there, look down the hiearchy until a // Script resource with name *diag* is found up.type=JBossAS Server up.name=* down.type=Script down.name=diag* Option 4 - XPath-like DSL w/ancestor & descendant filters../type[script],name=myscript OR ../../../type[script],name=script-getter/ OR ../../type[JBossAS:JVM]/type[JMX:Memory]/type[JMX:memorysubsystem],name[perm] OR ../../children/type[Memory]/type[memorysubsystem],name[permgen] OR ancestor[type=blah]/descendant[type=foobar] Tokens and parametersTo pass parameters to an operation, the "normal" operation parameter UI is used like on the Operations tab of a resource. It will be possible to pass tokens for parameters, that can be interpreted by the plugin sender. The switch determines if the token will be passed literally or replaced by current values. Tokens will follow the RHQ token conventions <% * %> token spaces are
PermissionsThe user that creates the AlertDefinition needs to be recorded and operation execution needs to be checked against the users permissions at fire time. To reduce unpleasant surprises, the permissions should directly be checked at the time the alert definition is created and operations the user has no rights to execute should not be offered to the user. Alert Auditing needs to contain the user who defined the definition. And especially if the operation could not be executed due to missing permissions at fire time. Code changes
Migration of existing operationsWe need to migrate existing operation alert-notifications. This can be done in two ways:
DocumentationDocumentation needs to be created on
Those pieces need to be linked into the general Alert documentation Required QAMake sure existing operations continue to work. Open QuestionsDo we want to support groups of resources here at all? Simple resources will allow for a much simpler solution: evaluation of the expression can be done at the time the AlertDefinition is edited, as single resources can not change their members Tokens for alert-operations senderNote: remember that all replacements must use the form of <% token %> alert: Information about the alert itself
resource: Information about the resource that triggered the alert
targetResource: Information about the resource the alert is fired on
operation: Information about the triggered operation
test: Just some dummy tokens for internal testing purposes
|