# Is it possible to retrieve detailed session information at the command line?

**URL:** <https://community.thinlinc.com/t/is-it-possible-to-retrieve-detailed-session-information-at-the-command-line/664>\
**Category:** Knowledge Base\
**Tags:** admin, cli, tlserver\
**Created:** [28 July 2023 04:48 UTC](https://community.thinlinc.com/t/is-it-possible-to-retrieve-detailed-session-information-at-the-command-line/664 "2023-07-28T04:48:21Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![aaron](https://dub1.discourse-cdn.com/flex005/user_avatar/community.thinlinc.com/aaron/32/13_2.png) [@aaron](https://community.thinlinc.com/u/aaron)\
**Post date:** [28 July 2023 04:48 UTC](https://community.thinlinc.com/t/is-it-possible-to-retrieve-detailed-session-information-at-the-command-line/664/1 "2023-07-28T04:48:22Z")

</div>

Using ThinLinc’s [web administration interface](https://www.cendio.com/resources/docs/tag/tlwebadm.html), it is possible to see detailed information about sessions running on each agent. This includes things like the session creation time, client MAC address, session size, and whether anyone is connected to it or not:

 ![2023-07-27_09:46:30](https://europe1.discourse-cdn.com/flex005/uploads/thinlinc/original/1X/fddae190b3fbdcd3f270699ff8742e7f992e5b56.png)

In some cases it may be useful to be able to retrieve this information at the command line; for example for use in `/opt/thinlinc/etc/xstartup.d` scripts which get run at session startup. The tool `tl-session-param` ships with ThinLinc, and can be used for this purpose. There is even an `--eval` parameter for assigning the values to a shell variable directly. It can also be used at the command line _within a ThinLinc session_ in order to list parameters associated with that session:

```auto
$ tl-session-param -a /
termserv_hostname = tl.example.com
fbsize_x = 1024
fbsize_y = 768
display = 10
session_pid = 4399
agenthost = 127.0.0.1
client_params/
client_ip = 192.168.4.32
connectionstatus = connected
status = normal
sessionstart = 1690345528.7159708
last_connection = 1690416821.4426165
uid = 1001

```

Running `tl-session-param` within a session can be useful for support and help desk operations, for example when trying to troubleshoot a session. The output can either be provided by the user, or their session shadowed by an administrator. There is more information available via `tl-session-param` than there is in the web administration interface, such as the connected client version and smart card capabilities.

Session information can also be retrieved for any session at the server command line (i.e. _not inside a ThinLinc session_), provided that:

1. you are running `tl-session-param` on the same agent as the session you want the data for
2. you have access to the directory at `/var/opt/thinlinc/sessions/<username>/<session_id>`
3. the required shell environment variables `TLSESSIONDATA` and `USER` are set correctly

Because `sudo` tends to sanitize environment variables, it’s normally easier to `su` into the user account whose session you want the information for, and run the command:

```bash
TLSESSIONDATA=/var/opt/thinlinc/sessions/<username>/<session_id> tl-session-param -a /

```

Or alternatively, as `root`:

```bash
USER=<username> TLSESSIONDATA=/var/opt/thinlinc/sessions/<username>/<session_id> tl-session-param -a /

```
