Bug 7848 - tlctl is not script-friendly
Summary: tlctl is not script-friendly
Status: NEW
Alias: None
Product: ThinLinc
Classification: Unclassified
Component: Misc (show other bugs)
Target Milestone: LowPrio
Assignee: Bugzilla mail exporter
Depends on:
Reported: 2022-03-02 10:08 CET by Frida
Modified: 2023-09-05 11:24 CEST (History)
3 users (show)

See Also:
Acceptance Criteria:


Description Frida cendio 2022-03-02 10:08:19 CET
Some features in tlctl would be nice to be able to use in scripts. For example, to gather statistics or periodically abandoning old sessions. Right now the commands in tlctl are made to be human-readable and should not be considered stable enough to be used in scripts.
Comment 2 Tobias cendio 2022-03-24 14:09:51 CET
Table output from tlctl load list may display truncated extensive agent names as the max table width is constrained to 80 characters. Other columns are truncated under the same rules but that is far less likely to happen as numerical columns are typically thin.

When long agent names are truncated, there's no way to discern the full agent names from tlctl load list, if for instance sysadmin wants to use them as input to tlctl load show <agent>. 

A simple no-truncation flag could solve this, but perhaps it's better to include this addition in a script-friendly version of tlctl which would skip truncation altogether, as the problem at hand should be uncommon and the missing information is ultimately available in the web interface.
Comment 3 Linn cendio 2022-04-04 17:17:08 CEST
All printing on stdout and stderr for tlctl replaces any characters that it can't print by '?' (because of e.g. incompatible locale). 

This is likely not the behaviour we want for our scripts, as it would be more informative to show the unprintable byte sequences to ease trouble shooting.
Comment 4 William Sjöblom cendio 2023-09-05 09:42:44 CEST
Making tlctl more script friendly will open up doors for monitoring ThinLinc using Nagios, Grafana et al.

We should keep this use-case in mind.
Comment 5 William Sjöblom cendio 2023-09-05 11:22:18 CEST
A similar use case is collecting statistics from the ThinLinc cluster. Robert mentioned a few statistics that he deems useful:

- How many connected sessions on each agent
- Resource consumption per agent
- Resource utilization on a per user basis

For these, we just need momentary metrics that can be passed on to Prometheus for example. These statistics serve two distinct purposes:

1. Helps planning cluster expansion (how much/what hardware to buy etc.).
2. Gives hard numbers to justify the cost keeping the ThinLinc cluster up and running.

I see the above points as a good starting point for a couple of user stories.
Comment 6 William Sjöblom cendio 2023-09-05 11:24:58 CEST
I'm not saying that tlctl need to present all of these metrics out of the box. What I'm saying is that tlctl has the potential to be glued together with other tools to make the above statistics trivial to collect.

Note You need to log in before you can comment on or make changes to this bug.