orangeqs.juice.orchestration.telegraf#
Telegraf Utilities.
Module Contents#
Functions#
Download and add the InfluxDB GPG key. |
|
Create the InfluxDB repository file. |
|
Check if Telegraf is installed and install via native package manager. |
|
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(package_manager: orangeqs.juice.orchestration._package_manager.PackageManager, url: str = 'https://repos.influxdata.com/influxdata-archive.key', apt_key_path: str = _APT_GPG_KEY_PATH) None#
Download and add the InfluxDB GPG key.
Parameters#
package_manager (PackageManager): Host package manager (
aptordnf).url (str): URL of the InfluxData signing key.
apt_key_path (str): Destination path for the dearmored key when using
apt.
- orangeqs.juice.orchestration.telegraf.add_influxdb_repo(package_manager: orangeqs.juice.orchestration._package_manager.PackageManager, dest: str | None = None) None#
Create the InfluxDB repository file.
Parameters#
package_manager (PackageManager): Host package manager (
aptordnf).dest (str | None): Optional output path for the repository configuration.
- orangeqs.juice.orchestration.telegraf.install_telegraf(package_manager: orangeqs.juice.orchestration._package_manager.PackageManager) bool#
Check if Telegraf is installed and install via native package manager.
Parameters#
package_manager (PackageManager): Host package manager (
aptordnf).
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.