ConfigHelper

class sitchlib.ConfigHelper(sitch_var_base_dir='/data/sitch/')[source]

Manage configuration information for entire SITCH Sensor.

build_logrotate_config()[source]

Generate logrotate config file contents.

classmethod get_db_schema_translations(filename='/etc/schemas/feed_db_translation.yaml')[source]

Get the feed DB schema translations from file.

classmethod get_db_schemas(filename='/etc/schemas/feed_db_schema.yaml')[source]

Get the feed DB schemas from file.

classmethod get_filebeat_template(filename='/etc/templates/filebeat.json')[source]

Get the filebeat config from template file.

classmethod get_from_env(k)[source]

Get configuration items from env vars. Hard exit if not set.

get_gps_device_port()[source]

Get GPS device from detector, override with env var.

get_gsm_modem_port()[source]

Get GSM modem port from detector, override with env var.

classmethod get_list_from_env(k, optional=False)[source]

Get a list from environment variables.

If optional=True, the absence of this var will cause a hard exit.

get_secret_from_vault()[source]

Retrieve secrets from Vault.

print_devices_as_detected()[source]

Print detected GPS and GSM devices.

classmethod set_filebeat_logfile_paths(log_prefix, filebeat_config)[source]

Sets all log file paths to align with configured log prefix.

write_filebeat_config()[source]

Write out filebeat config to file.