orangeqs.juice.orchestration.telegraf#

Telegraf Utilities.

Module Contents#

Functions#

add_influxdb_gpg_key

Download and add the InfluxDB GPG key using rpm.

add_influxdb_repo

Create the InfluxDB repo file with appropriate content and permissions.

install_telegraf

Check if Telegraf is installed; if not, install it using dnf.

influxdb2_token_exists

Check if the Telegraf systemd env file exists and contains an INFLUX_TOKEN.

write_token_to_service_env

Write influxDB2 token to the systemd services env file.

configure_rsyslog_for_telegraf

Create an rsyslog config file to forward logs to Telegraf using RFC 5424.

render_telegraf_config

Render the configuration for telegraf.

add_telegraf_to_sudoers

Add sudo permissions to telegraf to run podman stats.

API#

orangeqs.juice.orchestration.telegraf.add_influxdb_gpg_key(url: str = 'https://repos.influxdata.com/influxdata-archive.key') None#

Download and add the InfluxDB GPG key using rpm.

orangeqs.juice.orchestration.telegraf.add_influxdb_repo(dest: str = '/etc/yum.repos.d/influxdata.repo') None#

Create the InfluxDB repo file with appropriate content and permissions.

orangeqs.juice.orchestration.telegraf.install_telegraf() bool#

Check if Telegraf is installed; if not, install it using dnf.

Returns#

  • bool (False if Telegraf was already installed.)

orangeqs.juice.orchestration.telegraf.influxdb2_token_exists() bool#

Check if the Telegraf systemd env file exists and contains an INFLUX_TOKEN.

orangeqs.juice.orchestration.telegraf.write_token_to_service_env(token: str) None#

Write influxDB2 token to the systemd services env file.

Parameters#

  • token (str): The token to be written to Telegraf services environment.

orangeqs.juice.orchestration.telegraf.configure_rsyslog_for_telegraf() None#

Create an rsyslog config file to forward logs to Telegraf using RFC 5424.

orangeqs.juice.orchestration.telegraf.render_telegraf_config(config: orangeqs.juice.orchestration.settings.TelegrafSettings) None#

Render the configuration for telegraf.

Overwrites the file if it already exists.

Parameters#

  • config (TelegrafSettings): The telegraf settings to render.

orangeqs.juice.orchestration.telegraf.add_telegraf_to_sudoers() None#

Add sudo permissions to telegraf to run podman stats.