Skip to main content
Version: 4.1.0

Configuration

Internal Configuration

Fix Inventory uses an internal configuration system for its components. Configuration is maintained within Fix Inventory Core and can be edited using Fix Inventory Shell using the config edit command.

Listing Configurations

Start the Fix Inventory Shell
$ fixsh --psk changeme --fixcore-uri https://fixcore.fixinventory.svc.cluster.local:8900
note

Be sure to adjust the above PSK and Fix Inventory Core URI arguments to reflect your setup!

List available configurations
> configs list

Fix Inventory automatically creates the following configurations by default:

  • fix.core
  • fix.core.commands
  • fix.worker
  • fix.metrics

Editing Configuration

Edit the Fix Inventory Worker configuration
> config edit fix.worker

Upon execution of the above command, Fix Inventory Shell presents the specified configuration in YAML format using the local text editor as defined by the EDITOR environment variable.

Example Fix Inventory Worker configuration
fixworker:
# Enable cleanup of resources
cleanup: false
# Do not actually cleanup resources, just create log messages
cleanup_dry_run: true
# How many cleanup threads to run in parallel
cleanup_pool_size: 16
# List of collectors to run
collector:
- aws
- gcp
- k8s
# Dump the generated JSON data to disk
debug_dump_json: false
# Use forked process instead of threads
fork_process: true
# Name of the graph to import data into and run searches on
graph: fix
# Resource kind to merge graph at (cloud or account)
graph_merge_kind: cloud
# Collector thread/process pool size
pool_size: 5
# Directory to create temporary files in
tempdir: null
# Collection/cleanup timeout in seconds
timeout: 10800
# IP address to bind the web server to
web_host: '::'
# Web root in browser (change if running behind an ingress proxy)
web_path: /
# Web server tcp port to listen on
web_port: 9956
...
...
note

While the configuration is presented in YAML format for easy editing, all configuration is stored within Fix Inventory's database in a data structure following a strictly typed model.

This means that you will get an error if, for instance, you attempt to set the value of fixworker.pool_size to foobar, because pool_size is of type int.

Setting Individual Properties

Instead of editing a component's configuration in a text editor, it is also possible to set the values of specific properties using the config set command.

> config set fix.worker fixworker.pool_size=5

Overriding Individual Properties

Fix Inventory also has support for overriding configuration. Overrides allow for values like passwords, credentials, and API keys to be retrieved from a secure credential store and passed into the environment, rather than being stored as plain text inside Fix Inventory's database.

There are two ways to overriding configuration properties:

  1. --override flag

    $ fixworker --override fixworker.pool_size=5 fixworker.cleanup_pool_size=20
  2. <COMPONENT_NAME>_OVERRIDE environment variable

    $ export FIXWORKER_OVERRIDE=fixworker.pool_size=5
    $ fixworker

It is possible to override multiple values by delimiting them with a space:

$ export FIXWORKER_OVERRIDE="fixworker.pool_size=5 fixworker.cleanup_pool_size=20"
$ fixworker

Alternatively, if a value contains a space, it is also possible to use separate, enumerated environment variables:

$ export FIXWORKER_OVERRIDE0=fixworker.pool_size=5
$ export FIXWORKER_OVERRIDE1=fixworker.cleanup_pool_size=20
$ fixworker

Overriding List Properties

If the property type is a list/an array, it is possible to specifying multiple values as a comma-separated list of values:

  $ fixcore --override fixcore.api.web_hosts=127.0.0.1,10.0.0.1

or

  $ export FIXCORE_OVERRIDE=fixcore.api.web_hosts=127.0.0.1,10.0.0.1

Restoring Defaults

Default configurations can be restored simply by deleting the configuration and restarting the component.

Delete the Fix Inventory Worker configuration
> config delete fix.worker
Restart Fix Inventory Worker
$ fixworker

Environment Variables

Text Editor

The text editor opened by Fix Inventory Shell can be configured via the EDITOR environment variable.

When running Fix Inventory in Docker, the default text editor is nano.

$ export EDITOR=nano

Logging Format

Fix Inventory components produce logs in JSON format by default, with the exception of Fix Inventory Shell.

The rationale behind this behavior is that Core, Worker, and Metrics are likely running on something like a Kubernetes cluster in a data center, with logs ingested by a central logging system. Fix Inventory Shell, on the other hand, is executed on a user's local machine so the log output is formatted for readability.

JSON-format logging can be disabled via the FIX_LOG_TEXT environment variable:

$ export FIX_LOG_TEXT=true