CLI scripts on the server

Lukas Krejci lkrejci at redhat.com
Thu Jan 6 12:38:51 UTC 2011


Hi all,

I'm writing this to turn your attention to a new feature that is (hopefully) 
going to appear in RHQ 4 and that I think can have a large potential for 
further improvements in the future (or maybe even in scope of RHQ 4).

The feature is described in the BZ 
https://bugzilla.redhat.com/show_bug.cgi?id=667290 and is about adding the 
ability to execute a CLI script on the server side as a reaction on an alert 
(i.e. this is going to become a new alert plugin).

But thinking about this some more, I think that this could become a way of 
providing custom functionality to the RHQ server UI by the users themselves. 
Actually, this is something me and Filip talked about at the time the CLI 
concept was being developed but we never got round to even formulate the ideas 
and bring them forward to the team. I'm sure most of us have had similar ideas 
but the backlog of the tasks was just too big for them to bubble up to the 
attention :)

Obviously, we'd need to flesh out the security implications but at the same 
time I don't think there's much more to decide security wise than what user 
will the script run as and whether the CLI will have only access to remote 
interfaces even if running on the server or if we are going to let it use the 
full local interface.

Anyways, having the ability to run custom CLI directly on the server would 
enable us to do things like:

1) execute CLI script as an alert notification (huh? ;) ) - what user would 
this script run as?
2) Have CLI UI - a commandline interface in the browser for people that don't 
click
3) Let the user create their own custom scripts and expose them somewhere in 
the UI as single click actions. These could be global or maybe even per 
resource/group, where the resource/group object could be injected in the scope 
of the script automatically.
4) ...

Wrt. 3), to an extent we kind of did something like that already with the GWT 
user interface I guess. But I don't know GWT enough to guess whether there is 
even a remote chance of writing a "user-friendly" API that would interface 
with our GWT services and if there is a possibility to later execute such 
scripts client-side using something like eval("The user wrote this script;");

What are your thoughts? What aspects of the server should be scriptable?

Cheers,

Lukas


More information about the rhq-devel mailing list