Bug 534869 (RHQ-1623)

Summary: Add possibility to execute a script as a reaction to an alert.
Product: [Other] RHQ Project Reporter: Joao Paulo Viragine <jpviragine>
Component: AlertsAssignee: Heiko W. Rupp <hrupp>
Status: CLOSED CURRENTRELEASE QA Contact: Sudhir D <sdharane>
Severity: medium Docs Contact:
Priority: medium    
Version: unspecifiedCC: cwelton, hrupp, jginzburg, jpviragine, uaarkoti
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: All   
URL: http://jira.rhq-project.org/browse/RHQ-1623
Whiteboard:
Fixed In Version: 2.4 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-08-12 16:48:58 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 535339, 536210    
Bug Blocks:    

Description Joao Paulo Viragine 2009-02-20 20:37:00 UTC
Add possibility to execute a script as a reaction to an alert. 
Currently, we only have the choice to execute an operation as a reaction to an alert.

Comment 1 Heiko W. Rupp 2009-02-22 16:50:15 UTC
We are planning for the future to execute operations on 'arbitrary' resources - which could also be script resources. Would this be what you are proposing?

Comment 2 Joao Paulo Viragine 2009-02-22 19:15:37 UTC
Currently, we only have the choice to execute a *predefined* operation as a reaction to an alert.
I think that execute a script would be a very flexible choice, besides the *predefined* operations (Control type)  .

For example:

The only options available as a "reaction" to an alert for resource type JBoss AS are:

Control type:
none
Restart
Shutdown
Start

Execute a script would be a useful choice.

Thus, besides executes the operations (Restart, Shutdown, Start) we have a choice to execute a script.





Comment 3 Udaypal Aarkoti 2009-09-24 17:58:33 UTC
There will always be some unorthodox processes in every enterprise and its hard to cover every use case and that's where executing an arbitrary script will come in handy. The use case that was presented is quite normal where on an alert user wants to execute a script. That way if an enterprise has invested significant amount of time building scripts to handle certain use cases we will allow them to reuse them.

It also becomes an extension point.

Comment 4 Red Hat Bugzilla 2009-11-10 20:36:56 UTC
This bug was previously known as http://jira.rhq-project.org/browse/RHQ-1623


Comment 5 Heiko W. Rupp 2010-02-24 09:36:46 UTC
I am currently working on this in the form of the alert-operations notifications sender.

Comment 6 Heiko W. Rupp 2010-04-14 14:51:37 UTC
This is included in https://bugzilla.redhat.com/show_bug.cgi?id=535339

Comment 7 Sudhir D 2010-05-21 08:02:51 UTC
This can be achieved now, by script execution for a relative resource type. 

1.Browse through to the JBoss AS Server
2.Create a new alert definition with condition when JVM Free mem reaches
critical value.
3.Click on Edit for the Alert Notification.
4.On the Alert notification page, click on Add New. Select the Alert sender
type as Resource Operations.
5.Select the resource selection mode as Relative Resource. 
6.Click Save
7.Select Start search from as "JBoss AS Server"
8.Click Save.
9.Select Then Filter by as "Script"
10.Provide the restart script name. (Ensure that this script is under
~/jbossas/bin directory.)
11.Select operation name as "Execute Script"
12.Click Save.

Marking this bug as verified.

Comment 8 Corey Welton 2010-08-12 16:48:58 UTC
Mass-closure of verified bugs against JON.