You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@guacamole.apache.org by faris backer <fa...@gmail.com> on 2019/05/16 10:42:03 UTC

Killing a guacamole session programatically

Is there any way to terminate/Kill guacamole existing session
programmatically. 

*Scenario:*
Workspace is hosted in aws environment and we have scripts to hibernate the
instance when not in use for some time. But that script doesn't terminate
the existing session from guacamole servers. and the users will not be able
to connect to instances as it's in stop state.   
We do have a script to start the instance when the user tries to log in
again with the new session. But if the user tries to reconnect existing
session they will not be able to do so. 

I have seen guacamole client admin page where we can kill the session. But
is there any way we can terminate through our scripts. Any table we need to
delete the entry to kill sessions.



--
Sent from: http://apache-guacamole-general-user-mailing-list.2363388.n4.nabble.com/

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@guacamole.apache.org
For additional commands, e-mail: user-help@guacamole.apache.org


Re: Killing a guacamole session programatically

Posted by Nick Couchman <ni...@gmail.com>.
On Thu, May 16, 2019 at 6:42 AM faris backer <fa...@gmail.com>
wrote:

> Is there any way to terminate/Kill guacamole existing session
> programmatically.
>

Yes - the entire user interface is REST API driven, so terminating a
session can also be done with the API.  If you go into the browser
Developer Console and watch network traffic while you do things within the
GUI you should be able to see the network calls.  For killing the sessions,
you basically PATCH to the following endpoint:
http://server/guacamole/api/session/data/<data
source>/activeConnections?token=<token>

Within that call you need to put some data in the body of the PATCH request:
{op: "remove", path: "/<session-uuid>"}

You can do multiple operations concurrently - you can essentially feed it
an array of operations to do on different sessions.

I've also written a really basic python script that demonstrates some of
these items - see the following repo:

https://github.com/necouchman/guacamole-python

-Nick