On Sun, Dec 31, 2017 at 10:05 AM, Nick Couchman <vn...@apache.org> wrote:

> On Sun, Dec 31, 2017 at 5:24 AM, Michael Niehren <mich...@niehren.de>
> wrote:
>
>> Hi Nick,
>>
>> my intention was to administrate guacamole without using the client
>> interface. With an console utility you can do much more things like
>> - monitoring the usage in realtime (Nagios)
>> - automatically kill a session running longer than x minutes ...
>> - showing the current login's in another application
>> - ...
>>
>
> As a lifelong proponent of using the command line over GUIs whenever
> possible, I definitely understand the desire to have a utility that would
> allow this.  A couple of things I would point out in this regard:
> - You still probably want to do this on the Guacamole Client side, not on
> the guacd side.  guacd does not keep track of Guacamole Client usernames -
> the sessions are tracked by UUID - so you'd have to interface with the
> client, anyway, or try to determine which UUID to manipulate based on the
> parameters of the connection, which seems sketchy at best.
> - Doing this on the client side ought to be pretty straight-forward,
> though, because you can make use of the wonderful REST API that the web
> interface already uses.  Everything that is done on the Guacamole Client
> web UI, with the exception of the tunnel itself, is handled via REST API
> calls that returns JSON-formatted data.  So, it should be pretty
> easy/straightforward to create a command line utility, written in C,
> Python, Java, NodeJS, or even just using bash + curl, to login to the API
> and get the TOKEN, and then perform whatever administrative tasks you want
> to do, which would be pretty much anything you can do on the web side,
> including the things you mentioned above, but also things like user
> management, connection management, permissions, etc.
>
> I do really like the idea of creating a command-line utility to go along
> with the Guacamole Client package - maybe some of the other developers
> could weigh in on whether they think this would be something worth rolling
> into the overall Guacamole Client package, at which point we could create a
> JIRA issue to track the request.  If you're at all familiar with REST APIs
> and programming languages, you could start implementing one on your own :-).
>
> -Nick
>


Here's a quick/simple example of a Python-based utility that logs in to
Guacamole, gets active connections, and logs out:

https://pastebin.com/6LdWCwdm

-Nick

Reply via email to