Skip to main content

 

ThoughtSpot

tscli Command Reference

Overview

Explains what the feature is or what its benefits are to the user or customer.

Feature

The tscli command line interface is an administration interface for the ThoughtSpot Analytic Search Appliance. Use tscli to take snapshots (backups) of data, apply updates, stop and start the services, and view information about the system.

Usage for tscli is:

tscli [-h] [--helpfull] [--verbose] [--noautoconfig]
      [--autoconfig] [--yes] [--cluster <cluster>]
      [--zoo <zookeeper>]
      {alert, backup, callhome, cluster, command, 
      event, fileserver, firewall, ldap, logs, 
      monitoring, nas, node, os, release, saml, security, 
      smtp, snapshot, ssl, storage, support} ...
Table 1. tscli commands
Command Description
tscli [<command>] -h
Shows help, optionally for the specified command.
tscli alert count
Shows counts of generated alerts by type.
tscli alert list
Lists all the generated alerts.
tscli alert off
Disables all alerts from the cluster.
tscli alert on
Enables alerts from the cluster.
tscli alert status
Shows the status of cluster alerts.
tscli backup create 
   [--mode {full|light|dataless}]
   <name> <directory>
Same as the tscli snapshot backup command.
Pulls a snapshot and saves it as a backup where:
  • <name> is the name of the snapshot to pull out as a backup.
  • <directory> is the new directory that will be created for the backup. This directory must not already exist.

Use --mode to specify the type of backup.

tscli backup disable-periodic
Disables periodic backups. Restarts the cluster when applied.
tscli backup mirror-status
Checks whether the current cluster is running in mirror mode or not.
tscli backup periodic-config
Shows the periodic backup configuration.
tscli backup periodic-status
Shows the periodic backup status.
tscli backup restore
  [--release <release>]
   <backupdir>
Restores a cluster using the backup from the directory specified by <backupdir>, from the release file optionally specified by <release>.
tscli backup 
   set-periodic 
   --at <hour1, hour2, ...>
   --directory <directory>
   [--num_backups <num_backups>]
   [--mode {full|light|dataless}]
Enables or updates a periodic full backup configuration where:
  • <hour1, hour2, ...> is the list of times at which to take backups daily. Comma separated string of hour of day specified as HH using a 24 hour clock (e.g. 01, 13, 23).
  • <directory> is the directory where backups are to be written.
  • <num_backups> is the number of backups to keep archived.

Use --mode to specify the type of backup.

tscli backup 
   start-mirror <directory>
   <node1, node2, ...>
   <cluster_name> <cluster_id>
Starts a mirror cluster which will continuously pull backups generated from a primary cluster where:
  • <directory> is the directory where backups from the primary cluster are written (usually a SAN or NFS mounted drive).
  • <node1, node2, ...> is a comma separated list of IP addresses of the nodes in the mirror cluster.
  • <cluster_name> is the cluster name of the mirror cluster.
  • <cluster_id> is the ID of the mirror cluster.
Used only in systems specifically architected for disaster recovery.
tscli backup stop-mirror
Stops mirroring on the local cluster. Used only in systems specifically architected for disaster recovery.
tscli callhome disable
Turns off the periodic call home feature.
tscli callhome enable 
   --customer_name <customer_name>
Enables the "call home" feature, which sends usage statistics to ThoughtSpot Support every six hours via the secure file server.

Before using this command for the first time, you need to set up the file server connection using tscli fileserver configure.

The parameter <customer_name> takes the form Shared/<customer_name>/stats.

Contact ThoughtSpot if you do not know the customer name to specify.
tscli callhome generate-bundle
   --d <directory>
Generates a tar file of the cluster metrics and writes it to the specified directory.
tscli cluster create <release>
Creates a new cluster from the release file specified by <release>. This command is used by ThoughtSpot Support when installing a new cluster. Example:
$ tscli cluster create 2.0.4.tar.gz
tscli cluster restore 
   --release <release_tarball>
   <backupdir>
Restores a cluster using the backup in the specified directory <backupdir>. If you're restoring from a dataless backup, you must supply the release tarball for the corresponding software release.
tscli cluster start
Starts the cluster.
tscli cluster status
Gives the status of the cluster, including release number, date last updated, number of nodes, and services status.
tscli cluster stop
Pauses the cluster (but does not stop storage services).
tscli cluster update <release>
Updates an existing cluster using the release file specified by <release>. This command is used by ThoughtSpot Support when updating a cluster to a new release.
tscli command run
Runs a command on all nodes.
tscli event list 
   [--include <all|config|notification>] 
   [--since <hours,minutes,days>
   | --from <yyyymmdd-HH:MM> 
   --to <yyyymmdd-HH:MM>] 
   [--detail] 
   [--summary_contains
   <'string1'| 'string2' ...>]
   [--detail_contains 
   <'string1'| 'string2' ...>]
   [--attributes
   <key1='value1'|
   key2='value2' ...>]
Optional parameters are:
  • --include specifies the type of events to include, and can be all, config, or notification.
  • --detail returns the events in a detail format rather than a tabular summary, which is the default.
  • --summary_contains <'string1'| 'string2' ...> specifies a string to check for in the event summary. Enclose strings in single quotes, and separate multiple strings with |. Events that match all specified strings will be returned.
  • --detail_contains <'string1'| 'string2' ...> specifies a string to check for in the detail. Enclose strings in single quotes, and separate multiple strings with |. Events that match all specified strings will be returned.
  • --attributes <key1='value1'| key2='value2' ...> specifies attributes to match as key=value pairs. Separate multiple attributes with |. Events that match all specified key/value pairs will be returned. Put single quotes around the value(s).
And a time window made up of either:
  • --since <hours,minutes,days> is a time in the past for where the event audit begins, ending at the present time. Specify a human readable duration string, e.g. 4h (4 hours), 30m (30 minutes), 1d (1 day).
Or both:
  • --from <yyyymmdd-HH:MM> is a timestamp for where to begin the event audit. It must be of the form: yyyymmdd-HH:MM.
  • --to <yyyymmdd-HH:MM> is a timestamp for where to end the event audit. It must be of the form: yyyymmdd-HH:MM.
tscli fileserver configure 
   --user <user_name>
   [--password <password>]
Configures the secure file server username and password for file upload/download and the call home feature. You only need to issue this command once, to set up the connection to the secure file server. You only need to reissue this command if the password changes. The parameter <password> is optional. If a password is not specified, you will be prompted to enter it.
tscli fileserver 
   download-release <release>
   [--user <user_name>
   --password <password>]
Downloads the specified release file and its checksum. Specify the release by number, to the second decimal point (e.g. 3.1.0, 3.0.5, etc.). You may optionally specify the --user and --password to bypass the credentials that were specified when configuring the file server connection with tscli fileserver configure.

Before using this command for the first time, you need to set up the file server connection using tscli fileserver configure.

tscli fileserver purge-config
Removes the file server configuration.
tscli fileserver show-config
Shows the file server configuration.
tscli fileserver upload
   --file_name <file>
   --server_dir_path <path>
   [--user <user_name>
   --password <password>]
Uploads the file specified to the directory specified on the secure file server. The <path> parameter specifies the directory to which you want to upload the file. It is based on your customer name, and takes the form /Shared/support/<customer_name>. If you don't know the path to specify, Contact ThoughtSpot. You may optionally specify the --user and --password to bypass the credentials that were specified when configuring the file server connection with tscli fileserver configure.

Before using this command for the first time, you need to set up the file server connection using tscli fileserver configure.

tscli ldap add-cert 
   <name> <certificate>
Adds an SSL certificate for LDAP. Use only if LDAP has been configured without SSL and you wish to add it. Use <name> to supply an alias for the certificate you are installing.
tscli ldap configure
Configures LDAP using an interactive script. You can see detailed instructions for setting up LDAP in About LDAP Integration.
tscli ldap purge-configuration
Purges (removes) any existing LDAP configuration.
tscli logs collect 
  --include <selector | glob> 
  [--exclude <selector | glob>] 
  [--since <hours,minutes,days> 
  | --from <yyyymmdd-HH:MM> 
  --to <yyyymmdd-HH:MM>] 
  [--out <path>]
  [--maxsize <size_in_MB_or_GB>]
  [--sizeonly]
Extracts logs from the cluster. Does not include any logs that have been deleted due to log rotation.

Required parameters are:

  • --include <selector | glob> is a comma separated list of logs to include. Each entry is either a selector (one of all, orion, system, or ts) or a glob for matching files. Anything starting with / is assumed to be a glob pattern and interpreted via find(1). Other entries are ignored. TIP: put single quotes around the parameter value to prevent undesired glob expansion.
And a time window made up of either:
  • --since <hours,minutes,days> is a time in the past for where log collection begins, ending at the present time. Specify a human readable duration string, e.g. 4h (4 hours), 30m (30 minutes), 1d (1 day).
Or both:
  • --from <yyyymmdd-HH:MM> is a timestamp for where to begin log collection. It must be of the form: yyyymmdd-HH:MM.
  • --to <yyyymmdd-HH:MM> is a timestamp for where to end log collection. It must be of the form: yyyymmdd-HH:MM.

Optional parameters are:

  • --exclude <selector | glob> is a comma separated list of logs to exclude. Each entry is either a selector (one of orion, system, or ts) or a glob for matching files. Anything starting with / is assumed to be a glob pattern and interpreted via find(1).
  • --out <path> is the location where log tarball is written. If not specified, the tarball will be written in /tmp.
  • --maxsize is the maximum size to allow. Only fetches logs if the total size is smaller that this value. Can be specified in megabytes or gigabytes, e.g. 100MB, 10GB.
  • --sizeonly means do not collect logs. Just report the size.
tscli logs runcmd --cmd command>
   [--include selector | glob>]
   [--exclude selector | glob>]
   [--since hours,minutes,days> 
   | --from yyyymmdd-HH:MM> 
   --to yyyymmdd-HH:MM>] 
   [--outfile <path>]
   [--outdir <directory_path>]
   [--cmd_infmt [C | U]]
   [--cmd_outfmt [C | U]]
Runs a Unix command on logs in the cluster matching the given constraints. Results are reported as text dumped to standard out, the specified output file, or as tarballs dumped into the specified directory.

Required parameters are:

  • --cmd <command> is a Unix command to be run on the selected logs. Use single quotes to escape spaces, etc. Language used to specify the command has following rules.
    1. A logfile and its corresponding result file can be referenced using the keywords SRCFILE and DSTFILE. E.g. 'cp SRCFILE DSTFILE'
    2. If there is no reference to DSTFILE in the command, '> DSTFILE' will be appended to the command for output redirection. E.g. 'du -sch SRCFILE' gets automatically translated to 'du -sch SRCFILE > DSTFILE'
    3. If there is no reference to SRCFILE, the content of the log is streamed tot he command using a pipe. E.g. 'tail -n100 | grep ERROR' gets automatically translated to 'cat SRCFILE | tail -n100 | grep ERROR > DSTFILE'
  • --include <selector | glob> is a comma separated list of logs to include. Each entry is either a selector (one of all, orion, system, or ts) or a glob for matching files. Anything starting with / is assumed to be a glob pattern and interpreted via find(1). Other entries are ignored. TIP: put single quotes around the parameter value to prevent undesired glob expansion.
And a time window made up of either:
  • --since <hours,minutes,days> is a time in the past for where log collection begins, ending at the present time. Specify a human readable duration string, e.g. 4h (4 hours), 30m (30 minutes), 1d (1 day).
Or both:
  • --from <yyyymmdd-HH:MM> is a timestamp for where to begin log collection. It must be of the form: yyyymmdd-HH:MM.
  • --to <yyyymmdd-HH:MM> is a timestamp for where to end log collection. It must be of the form: yyyymmdd-HH:MM.

Optional parameters are:

  • --exclude <selector | glob> is a comma separated list of logs to exclude. Each entry is either a selector (one of orion, system, or ts) or a glob for matching files. Anything starting with / is assumed to be a glob pattern and interpreted via find(1).
  • --outfile <path> is the file path for printing all the results. By default, results get printed to stdout.

  • --outdir <directory_path> is the directory path for dumping results from each node, with their original directory structure. This may be used as an alternative to printing output to outfile/stdout.

  • --cmd_infmt [C | U] specifies if the input file should be compressed (C) or uncompressed (U) before running the command. Don't use this flag if the command works on both.

  • --cmd_outfmt [C | U] specifies if the output file generated by the command will be compressed (C) or uncompressed (U). Don't use this flag if the output file will be of the same format as the input file.

tscli monitoring set-config 
   --email <email> 
   --clear_email
   --heartbeat_interval
   <heartbeat_interval>
   --heartbeat_disable
   --report_interval
   <report_interval>
   --report_disable
Sets the monitoring configuration.

Parameters are:

  • --email <email> is a comma separated list (no spaces) of email addresses where the cluster will send monitoring information.

  • --clear_email disables emails by clearing the email configuration.

  • --heartbeat_interval <heartbeat_interval> is the heartbeat email generation interval in seconds. Must be greater than 0.

  • --heartbeat_disable disables heartbeat email genearation.

  • --report_interval <report_interval> sets the cluster report email generation interval in seconds. Must be greater than 0.

  • --report_disable disables cluster report email generation.

tscli monitoring show-config
Shows the monitoring configuration.
tscli nas mount-cifs
   --server <server_CIFS_address>
   --path_on_server <path>
   --mount_point <target>
   --username <user>
   --password <password>
   --uid <uid>
   --gid <gid>
Mounts a CIFS device on all nodes.

Parameters are:

  • --server <server_CIFS_address> is the device address.
  • --path_on_server <path> is the path on the server to mount (source).
  • --mount_point <target> is the location where the CIFS device should be mounted (target).
  • --username <user> is the username with which to connect to the CIFS device.
  • --password <password> is the CIFS password.
  • --uid <uid> is the uid that will own all files or directories on the mounted filesystem, when the server does not provide ownership information. See the man page for mount.cifs for more details.
  • --gid <gid> is the gid that will own all files or directories on the mounted filesystem, when the server does not provide ownership information. See the man page for mount.cifs for more details.
tscli nas mount-nfs
   --server <server_NFS_address>
   --path_on_server <path>
   --mount_point <target>
Mounts a NFS device on all nodes.

Parameters are:

  • --server <server_NFS_address> is the device address.
  • --path_on_server <path> is the path on server to mount (source).
  • --mount_point <target> is the location where the NFS device should be mounted (target).
tscli nas unmount
   --dir <directory>
Unmounts all devices from the specified directory location.
tscli node ls
Lists all nodes in the cluster.
tscli os find-package
   <package_name>
Lists all packages and versions included in the product image whose name contains <package_name>. Package names you can specify are:
  • alert
  • backup
  • callhome
  • cluster
  • event
  • fileserver
  • firewall
  • ldap
  • logs
  • monitoring
  • node
  • os
  • release
  • smtp
  • snapshot
  • ssl
  • storage
  • support
tscli os list-packages
Lists all packages and versions included in the product image.
tscli release
   info <release>
Prints information about the release contained in the specified release file.
tscli saml configure
Configures SAML.
tscli saml
   purge-configuration
Purges any existing SAML configuration.
tscli security
   clear-min-tls-version
Clears any customizations for the minimum TLS version to support.
tscli security
   set-min-tls-version
   {1.0|1.1|1.2}
Sets the minimum SSL version to be supported by the ThoughtSpot application. Please ensure that client browsers are enabled for this version or newer.
tscli security ssl-off
Disables SSL authentication for the ThoughtSpot application.
tscli security ssl-on
Enables SSL authentication for the ThoughtSpot application.
tscli security ssl-status
Shows whether of SSL authentication is enabled or disabled for the ThoughtSpot application.
tscli security tls-status
Prints the status of TLS support.
tscli smtp
   reset-canonical-mapping
Deletes the current postmap mapping.
tscli smtp
   set-canonical-mapping
   <new_key> <new_value>
Sets a new postmap mapping.
tscli smtp set-mailfromname
   <email_address>
Sets the mailname, from which email alerts are sent, for the cluster.
tscli smtp set-mailname
   <domain>
Sets the mailname, where email alerts are sent, for the cluster.
tscli smtp 
   set-relayhost <IP_address>
Sets the relayhost for SMTP (email) sent from the cluster.
tscli smtp show-canonical-mapping
Shows the current postmap mapping.
tscli smtp show-mailfromname
Shows the mailname, from which email alerts are sent, for the cluster.
tscli smtp show-mailname
Shows the mailname, where email alerts are sent, for the cluster.
tscli smtp show-relayhost
Shows the relayhost for SMTP (email) sent from the cluster. If there is no relayhost configured, the command shows "NOT FOUND".
tscli snapshot backup 
   [--mode {full|light|dataless}]
   <name> <directory>
Same as the tscli backup create command.
Pulls a snapshot and saves it as a backup where:
  • <name> is the name of the snapshot to use.
  • <directory> is the new directory that will be created for the backup. This directory must not already exist.

Use --mode to specify the type of backup.

tscli snapshot 
   create <name> <reason>
Creates a new snapshot with the name and reason provided.
tscli snapshot delete <name>
Deletes the named snapshot.
tscli snapshot ls
Lists available snapshots and their size.
tscli snapshot restore
   <name>
   [--allow_release_change]
Restores a cluster using the named snapshot. If --allow_release_change is specified, allows restoration to a snapshot at a different release.
tscli ssl add-cert
   <key> <certificate>
Adds SSL certificate, key pair.
tscli ssl off
Disables SSL. Disabling SSL will stop users from seeing a security warning when accessing ThoughtSpot from a browser if there is no SSL certificate installed.
tscli ssl on
Enable SSL. If SSL is enabled and there is no certificate, users will see a security warning when accessing ThoughtSpot from a browser.
tscli ssl rm-cert
Removes the existing SSL certificate, if any.
tscli ssl status
Shows whether SSL authentication is enabled or disabled.
tscli storage gc 
   [--log_age <hours>]
   [--localhost_only>]

Before issuing this command, you must stop the cluster using tscli cluster stop. After garbage collection has completed, you can restart the cluster with tscli cluster start.

Garbage collects unused storage. Accepts these optional flags:

--log_age <hours>

Specifies the number of elapsed hours after which logs will be deleted. Default is 24 hours.

--localhost_only

If used, only the logs on the localhost will be removed. If not specified, the command acts on the entire cluster.

The command frees space in these directories:
/tmp
/usr/local/scaligent/logs/
/export/logs/orion
/export/logs/oreo
/export/logs/hadoop
/export/logs/zookeeper
cores
tscli support restart-remote
Restarts remote support.
tscli support rm-admin-email
Removes the email address for contacting the customer administrator. Replaces it with the default ThoughtSpot Support email address.
tscli support rm-admin-phone
Removes the phone number for contacting the customer administrator. Replaces it with the default ThoughtSpot Support phone number.
tscli support 
   set-admin-email <email>
Sets the email address for contacting the customer administrator.
tscli support
   set-admin-phone <phone_number>
Sets the phone number for contacting the customer administrator. Specify a 10-digit phone number using only numbers (e.g. 8005551212).
tscli support set-remote
   --addr <support_address>
   --user <support_user>
Configures the cluster for remote support through SSH tunneling, where <support_address> is the address of support, e.g. tunnel.thoughtspot.com, and <support_user> is the support username.
tscli support
   show-admin-email
Shows the email address for customer administrator, if set.
tscli support
   show-admin-phone
Shows the phone number for customer administrator, if set.
tscli support
   show-remote
Prints the status and configuration of remote support.
tscli support
   start-remote
Starts remote support.
tscli support
   stop-remote
Stops remote support.
Table 2. tscli optional arguments
Argument Description
--verbose Turns on verbose logging to the console. By default, logs are written to both the console and log files, with the log files containing the highest verbosity log messages.
--helpfull Shows the full help text for all command sections.
--noautoconfig Will prompt for a y or n for each configuration question.
--autoconfig Automatically configure properties of the cluster when possible. User may still be prompted for certain inputs.
--yes Same as --autoconfig. Automatically configure properties of the cluster when possible. User may still be prompted for certain inputs.
--cluster <cluster_name> Optional. Used to designate the cluster to operate on by name, if it is not detected automatically.
--zoo <zookeeper_servers> Optional. Used to provide a comma-separated list of Zookeeper servers, when a cluster is not detected automatically.
  • Was this article helpful?