Skip to content

Command Line Options ​

When starting Butler SOS, you can pass command line options to customize its behavior.

Usage ​

shell
Usage: butler-sos [options]

Version: 15.5.0

Butler SenseOps Stats ("Butler-SOS") is a tool publishing operational Qlik Sense
metrics to InfluxDB, Prometheus, New Relic and other destinations.

User events and log events can be forwarded from Sense to Butler SOS and then
acted upon there.
Events can be stored in InfluxDB and sent to New Relic.

Add Grafana for great looking dashboards and you get real-time monitoring of
what happens inside a Qlik Sense environment.

More info at https://butler-sos.ptarmiganlabs.com

Options:
  -V, --version                        output the version number
  -c, --configfile <file>              path to config file (REQUIRED)
  -l, --loglevel <level>               log level (choices: "error", "warn",
                                       "info", "verbose", "debug", "silly")
  --new-relic-account-name  <name...>  New Relic account name. Used within
                                       Butler SOS to differentiate between
                                       different target New Relic accounts
  --new-relic-api-key <key...>         insert API key to use with New Relic
  --new-relic-account-id <id...>       New Relic account ID
  --skip-config-verification           Disable config file verification
                                       (default: false)
  --check-config                       check the config file and exit, without
                                       starting anything: exit code 0 when it is
                                       valid, 1 when it is not (default: false)
  --on-invalid-config <action>         what to do when the config file is not
                                       valid: exit, or wait without starting any
                                       service (choices: "exit", "wait",
                                       default: "exit")
  --install-service                    Windows only: install Butler SOS as a
                                       Windows service that runs with the other
                                       options given here, and start it. Needs
                                       an elevated prompt (default: false)
  --uninstall-service                  Windows only: stop and remove the Butler
                                       SOS Windows service, keeping its logs.
                                       Needs an elevated prompt (default: false)
  --service-name <name>                with --install-service or
                                       --uninstall-service: the name of the
                                       service, so that one server can run
                                       several. Letters, digits, "-", "_" and
                                       "." (default: butler-sos)
  --service-display-name <text>        with --install-service: the name
                                       services.msc shows (default: the service
                                       name)
  --service-description <text>         with --install-service: the description
                                       services.msc shows
  -h, --help                           display help for command

Configuration File:
  Butler SOS requires a configuration file to run. You must specify one using the -c option.
  
  Example config files are included in the distribution ZIP file, as well as online at:
    https://github.com/ptarmiganlabs/butler-sos/tree/master/src/config

Options Reference ​

-V, --version ​

Output the version number of Butler SOS.

Example:

shell
butler-sos --version

-c, --configfile ​

Specifies the configuration file to use. Required.

Valid values: A path to a configuration file. The file name must end in .yaml. A relative path is looked up from the directory Butler SOS is started in.

Example:

shell
butler-sos --configfile /path/to/my-config.yaml

Changed in 15.1.2

Started without -c, Butler SOS prints its help text followed by Error: No config file specified., and exits with code 1. Before 15.1.2 it exited with code 0 and gave no reason. See Which Config File to Use.


-l, --loglevel ​

Specifies the log level to use. When set, this overrides the log level specified in the configuration file.

Valid values: error, warn, info, verbose, debug, silly

Default: info

Example:

shell
butler-sos --loglevel debug

--skip-config-verification ​

Disable config file verification.

By default, Butler SOS verifies the config file when it starts. If the config file is invalid, Butler SOS prints a report of the problems and exits with code 1.

Use this option to disable config file verification. Butler SOS then starts on whatever the file contains. See Skipping config file verification.

Cannot be combined with --check-config.

Example:

shell
butler-sos -c /path/to/my-config.yaml --skip-config-verification

--check-config ​

New in 15.4.0

This option was added in Butler SOS 15.4.0.

Check the config file and exit, without starting anything. Butler SOS runs every check a normal start runs, on the file given with -c. It opens no ports, starts no services, and writes no log files.

The exit code is 0 when the file is valid and 1 when it is not.

  • Cannot be combined with --skip-config-verification.
  • Wins over --on-invalid-config wait: if both are given, Butler SOS checks and exits.

Example:

shell
butler-sos -c /opt/butler-sos/config/production.yaml --check-config

See Checking a config file without starting Butler SOS.


--on-invalid-config ​

New in 15.4.0

This option was added in Butler SOS 15.4.0.

What to do when the config file has a problem.

Valid values:

ValueWhat Butler SOS does when the config file has a problem
exitPrints the report and exits with code 1. This is the default, and what Butler SOS has always done.
waitPrints the report, starts none of its services, and keeps running until it is stopped.

Default: exit

With a valid config file, both values start Butler SOS normally.

Example:

shell
butler-sos -c /opt/butler-sos/config/production.yaml --on-invalid-config wait

See Staying up on an invalid config file.


Windows service options ​

--install-service, --uninstall-service, --service-name, --service-display-name and --service-description install and remove Butler SOS as a Windows service. They are described on the Windows service page.


-h, --help ​

Display help for command.


New Relic Options ​

When using New Relic as a backend for storing metrics, you can specify New Relic credentials in the config file—but that is not ideal from a security perspective.

To avoid storing credentials in the config file, you can specify them on the command line using the following options.

--new-relic-account-name ​

List of New Relic account names. Used within Butler SOS to differentiate between different target New Relic accounts to which data can be sent.

INFO

This name has nothing to do with the account name used in New Relic—it's purely for Butler SOS' internal use. Specifically, it's referenced at multiple places in the config file where you can specify to which New Relic account to send data.

  • Enclose account names in quotes if they contain spaces
  • Separate multiple account names with a space

Example:

shell
butler-sos --new-relic-account-name "Account 1" "Account 2"

--new-relic-api-key ​

List of New Relic API keys. Used to authenticate with New Relic.

  • Enclose API keys in quotes if they contain spaces
  • Separate multiple API keys with a space
  • The order of the API keys must match the order of the account names

Example:

shell
butler-sos --new-relic-api-key "API-key-1" "API-key-2"

--new-relic-account-id ​

List of New Relic account IDs. Used to identify the New Relic account to which data should be sent.

  • Enclose account IDs in quotes if they contain spaces
  • Separate multiple account IDs with a space
  • The order of the account IDs must match the order of the account names

Example:

shell
butler-sos --new-relic-account-id "12345678" "87654321"

Complete Example ​

Here's an example combining multiple options:

shell
butler-sos \
  --configfile /opt/butler-sos/config/production.yaml \
  --loglevel verbose \
  --new-relic-account-name "Production" "Development" \
  --new-relic-api-key "NRAK-xxxxxxxxxxxxx" "NRAK-yyyyyyyyyyyyy" \
  --new-relic-account-id "1234567" "7654321"

Released under the MIT License.