Bug 736762 - silent failure on CLI scripted alert with error
Summary: silent failure on CLI scripted alert with error
Keywords:
Status: CLOSED WORKSFORME
Alias: None
Product: RHQ Project
Classification: Other
Component: Alerts
Version: 4.1
Hardware: Unspecified
OS: Unspecified
medium
medium vote
Target Milestone: ---
: ---
Assignee: Lukas Krejci
QA Contact: Mike Foley
URL:
Whiteboard:
Depends On:
Blocks: 715380
TreeView+ depends on / blocked
 
Reported: 2011-09-08 15:58 UTC by Mike Foley
Modified: 2011-10-04 19:31 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-09-14 09:49:41 UTC


Attachments (Terms of Use)
CLIAlert script (2.89 KB, text/javascript)
2011-09-08 15:58 UTC, Mike Foley
no flags Details
server log (41.42 KB, text/plain)
2011-09-08 16:02 UTC, Mike Foley
no flags Details

Description Mike Foley 2011-09-08 15:58:45 UTC
Created attachment 522152 [details]
CLIAlert script

Description of problem:  silent failure on CLI scripted alert with error 



Steps to Reproduce:
1.  http://metlos.wordpress.com/2011/03/08/scripted-alert-notifications-in-rhq/
2.  (see attachment) 
3.
  
Actual results:
1) errors in server log, attached
2) silent failure, no information on the alert history notification tab that the notification had an error in it
 
Expected results:
some information on the alert history notification tab that the notification had an error in it


Additional info:  
the CLI script (attached) has an error in it, as follows:

java.lang.Runtime.getRuntime().exec('/somewhere/on/the/server/restart-database.sh')

Comment 1 Mike Foley 2011-09-08 16:02:38 UTC
Created attachment 522153 [details]
server log

Comment 2 Lukas Krejci 2011-09-14 09:49:41 UTC
I could not reproduce this. The system seems to behave as expected to me.

For reference, here's what I did:

1) Created a Repository "test"
2) Went to a platform, created alert on the change of "Free Memory" metric, created a CLI Script notification and uploaded the script to the test repo.
3) Saved the alert definition
4) waited for an alert to fire
5) Double clicked on the entry in the alert history

Here's what the notification subtab of the history entry shows:

Sender: CLI Script
Status: x
Message: Ran script bz-736762.js in version rhqadmin:1.0 from repo test as user rhqadmin.

javax.script.ScriptException:sun.org.mozilla.javascript.internal.EcmaError: ReferenceError: "MeasumentDefinitionManager" is not defined. (#19) in
at line number 19 in script bz-736762.js (rhqadmin:1.0) in repo test at line number 19


Note You need to log in before you can comment on or make changes to this bug.