CLI scripts on the server

John Mazzitelli mazz at redhat.com
Thu Jan 6 14:08:02 UTC 2011


Many months ago we talked about having a simple GUI page that let you 
enter in a CLI script, click "Execute" and have that CLI script run on 
the server (essentially, it allows you to not have to run the standalone 
CLI container - you just give the script in a textarea in the GUI and 
have the RHQ Server invoke it for you).

John Sanda may even have done some work in this area IIRC to start the 
implementation.

As for the "run a script as a notification", its definitely a good idea. 
The one big thing we have to answer is - where do we store the script?

Because right now, you can't use a simple configuration property to 
store it - our <simple-property> values can only store,at most, 4K 
characters. Too limiting to expect all CLI scripts to fit.

We'd have to write a special agent plugin (just like our Users and Roles 
server-side agent plugins), and have that plugin store the script in 
some other special table that has a CLOB column in which to store the 
script.

On 01/06/2011 07:38 AM, Lukas Krejci wrote:
> 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
> _______________________________________________
> rhq-devel mailing list
> rhq-devel at lists.fedorahosted.org
> https://fedorahosted.org/mailman/listinfo/rhq-devel


More information about the rhq-devel mailing list