Comment on page
Manage StackState using the CLI
This page describes StackState version 4.1.
The StackState 4.1 version range is End of Life (EOL) and no longer supported. We encourage customers still running the 4.1 version range to upgrade to a more recent release.
The StackState CLI can be used to configure StackState, work with data, and help with debugging problems. The CLI provides easy access to the functionality provided by the StackState API. The URLs and authentication credentials are configurable. Multiple configurations can be stored for access to different instances.
Use the CLI to export all or specific data from StackState. Exported data can be imported from file.
StackState configuration is stored in the StackState graph database (StackGraph) in configuration nodes. Use the
sts graph list-typescommand to see the types of all configuration nodes.
sts graph list-types
sts graph export -i ids_to_export > file_name
The example below will write all check functions to the file
sts graph list --ids CheckFunction | xargs sts graph export --ids > mycheckfunctions.stj
sts graph importcommand to import configuration previously exported configuration back into StackState.
sts graph import < file_name
# actual examples of use
The CLI makes it easy to send test data to StackState.
The CLI provides an
anomalycommand used to send anomaly data to StackState for a metric stream of a component.
sts anomaly send --component-name <Component> --stream-name <Metric Stream> --start-time=<time>
sts events sendto send a single event with a given name.
sts events send
You can use the CLI to send one data point of a given value or to generate a set of values within a defined bandwidth. This is useful if you want to check a new configuration with predictable data.
By default, generated metrics patterns are random between the specified bandwidth values. If a single bandwidth value is provided, the generated pattern will be a flat line. To generate a different type of pattern, use the arguments
sts metrics send [-b | -h | -p] <MetricName> <OptionalNumberValue> [--baseline | --linear ] --csv <file_name>
Please refer to
usage.mdin the CLI zip archive for detailed instructions.
All data flowing through StackState (e.g. topology, telemetry, traces, etc.) flows through topics. For debugging purposes, these topics can be inspected using the CLI. This can come in handy, for example, to make sure that StackState is receiving data correctly when you write your own integrations.
Get a list of all Kafka topics.
sts topic list
topic showcommand to display data for a specific topic.
sts topic show <topic>
The StackState CLI can be used to manage the StackPacks in your StackState instance.
To install a StackPack, you must first upload it to the StackState server.
# Upload a StackPack
sts stackpack upload /path/to/MyStackPack-1.0.0.sts
# Install an uploaded StackPack
sts stackpack install MyStackPack
# Provide parameters for StackPack install:
sts stackpack install -p param1 value1 -p param2 value2 MyStackPack
sts stackpack install -p sap_host sap1.acme.com stackpack-sap-1.0.1.sts
If you want to upgrade a StackPack, first upload the new StackPack version to the StackState server, then trigger the upgrade with the following command:
# Upload new StackPack version
sts stackpack upload /path/to/MyStackPack-1.0.1.sts
# Upgrade to the uploaded StackPack
sts stackpack upgrade MyStackPack
Note that StackState will upgrade to the latest StackPack version available on the StackState server.
Uninstall a StackPack as follows:
sts stackpack uninstall MyStackPack
sts scriptto execute a script via standard input. For example:
echo "Topology.query(\"label IN ('stackpack:aws')\")" | sts script execute
Note that the script provided as input must use proper quoting.
The StackState CLI can be used to check your license validity and update a license key when needed, for example, in case of expiration.
# check license key validity
sts subscription show
# Update license key
sts subscription update new-license-key
Note that it is not necessary to do this via the CLI. StackState will also offer this option in the UI when a license is about to expire or has expired.