Merge pull request #77 from mother-of-all-self-hosting/telegraf

Add Telegraf
This commit is contained in:
Slavi Pantaleev 2023-06-30 10:02:45 +03:00 committed by GitHub
commit a388e3c20e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 62 additions and 1 deletions

26
docs/services/telegraf.md Normal file
View file

@ -0,0 +1,26 @@
# Telegraf
[Telegraf](https://www.influxdata.com/) is a plugin-driven server agent for collecting & reporting metric, that this playbook can install, powered by the [mother-of-all-self-hosting/ansible-role-telegraf](https://github.com/mother-of-all-self-hosting/ansible-role-telegraf) Ansible role. It heavily depends on [InfluxDB](influxdb.md)
## Prerequisits
* A functioning [InfluxDB](influxdb.md) instance.
## Configuration
To enable this service, add the following configuration to your `vars.yml` file and re-run the [installation](../installing.md) process:
This role depends on InfluxDB. You need to obtain the influx token and config link in from InfluxDB.
In your browser, visit the InfluxDB instance and go to **Load Data** -> **Telegraf**.
There you need to add a Telegraf configuration. You can now obtain these values from the setup instructions and paste them here.
```yaml
telegraf_enabled: true
telegraf_influx_token: SUPERSECRETTOKEN
telegraf_config_link: https://influxdb.example.org/api/v2/telegrafs/0123456789
```
## Usage
In your InfluxDB instance, configure the Telegraf plugins as you like.

View file

@ -123,7 +123,7 @@ devture_systemd_service_manager_services_list_auto: |
+
([{'name': (infisical_identifier + '-frontend.service'), 'priority': 2000, 'groups': ['mash', 'infisical', 'infisical-frontend']}] if infisical_enabled else [])
+
([{'name': (influxdb + '.service'), 'priority': 2000, 'groups': ['mash', 'influxdb']}] if influxdb_enabled else [])
([{'name': (influxdb_identifier + '.service'), 'priority': 2000, 'groups': ['mash', 'influxdb']}] if influxdb_enabled else [])
+
([{'name': (jitsi_identifier + '-web.service'), 'priority': 4200, 'groups': ['mash', 'jitsi', 'jitsi-web']}] if jitsi_enabled else [])
+
@ -191,6 +191,8 @@ devture_systemd_service_manager_services_list_auto: |
+
([{'name': (syncthing_identifier + '.service'), 'priority': 2000, 'groups': ['mash', 'syncthing']}] if syncthing_enabled else [])
+
([{'name': (telegraf_identifier + '.service'), 'priority': 2000, 'groups': ['mash', 'telegraf']}] if telegraf_enabled else [])
+
([{'name': (vaultwarden_identifier + '.service'), 'priority': 2000, 'groups': ['mash', 'vaultwarden', 'vaultwarden-server']}] if vaultwarden_enabled else [])
+
([{'name': (uptime_kuma_identifier + '.service'), 'priority': 2000, 'groups': ['mash', 'uptime-kuma']}] if uptime_kuma_enabled else [])
@ -2397,6 +2399,34 @@ syncthing_container_labels_traefik_tls_certResolver: "{{ devture_traefik_certRes
# #
########################################################################
########################################################################
# #
# telegraf #
# #
########################################################################
telegraf_enabled: false
telegraf_identifier: "{{ mash_playbook_service_identifier_prefix }}telegraf"
telegraf_base_path: "{{ mash_playbook_base_path }}/{{ mash_playbook_service_base_directory_name_prefix }}telegraf"
telegraf_uid: "{{ mash_playbook_uid }}"
telegraf_gid: "{{ mash_playbook_gid }}"
telegraf_systemd_required_services_list: |
{{
(['docker.service'])
+
([(influxdb_identifier + '.service')] if influxdb_enabled else [])
}}
########################################################################
# #
# /telegraf #
# #
########################################################################
########################################################################

View file

@ -152,6 +152,9 @@
- src: git+https://github.com/mother-of-all-self-hosting/ansible-role-syncthing.git
version: v1.23.5-0
name: syncthing
- src: git+https://github.com/mother-of-all-self-hosting/ansible-role-telegraf.git
version: v1.27.1-1
name: telegraf
- src: git+https://gitlab.com/etke.cc/roles/uptime_kuma.git
version: v1.22.0-0
- src: git+https://github.com/mother-of-all-self-hosting/ansible-role-vaultwarden.git

View file

@ -131,6 +131,8 @@
- role: galaxy/syncthing
- role: galaxy/telegraf
- role: galaxy/vaultwarden
- role: galaxy/uptime_kuma