orangeqs.juice.orchestration.telegraf#
Telegraf Utilities.
Module Contents#
Functions#
Download and add the InfluxDB GPG key using rpm. |
|
Create the InfluxDB repo file with appropriate content and permissions. |
|
Check if Telegraf is installed; if not, install it using dnf. |
|
Check if the Telegraf systemd env file exists and contains an INFLUX_TOKEN. |
|
Write influxDB2 token to the systemd services env file. |
|
Create an rsyslog config file to forward logs to Telegraf using RFC 5424. |
|
Render the configuration for telegraf. |
|
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.