ansible/roles/stacks/composes/inventory/monitoring-exporters.yml

244 lines
10 KiB
YAML
Raw Normal View History

2023-09-26 16:09:27 +00:00
# 2023-09-26
2023-09-26 09:29:37 +00:00
# Stack: monitoring_exporters
---
monitoring_exporters:
name: "monitoring-exporters"
stack: "monitoring"
2023-09-26 16:09:27 +00:00
tasks:
- monitoring-exporters.yml
2023-09-26 09:29:37 +00:00
ipv6: true
secrets: true
directories:
2023-09-26 16:09:27 +00:00
- "{{ stack_folder_conf }}/exporters/mariadb/conf"
- "{{ stack_folder_conf }}/exporters/mysql/conf"
2023-09-26 09:29:37 +00:00
- "{{ stack_folder_conf }}/exporters/proxmox/conf"
- "{{ stack_folder_conf }}/exporters/snmp/conf"
- "{{ stack_folder_datas }}/exporters/freebox/datas"
- "{{ stack_folder_secrets }}/exporters/adguard/secrets"
- "{{ stack_folder_secrets }}/exporters/postgres/secrets"
services:
- name: "exporter-cadvisor"
override: { name: "monitoring-vm", service: "exporter-cadvisor" }
ressources:
2023-09-26 16:09:27 +00:00
cpu: "{{ vm_os_cpu_half }}"
memory: "{{ 4.0 if 4.0 <= vm_os_memory_max|float else vm_os_memory_max|float }}G"
2023-09-26 09:29:37 +00:00
- name: "exporter-node"
override: { name: "monitoring-vm", service: "exporter-node" }
ressources:
2023-09-26 16:09:27 +00:00
cpu: "{{ vm_os_cpu_half }}"
memory: "{{ 4.0 if 4.0 <= vm_os_memory_max|float else vm_os_memory_max|float }}G"
2023-09-26 09:29:37 +00:00
- name: "exporter-proxmox"
image: "prompve/prometheus-pve-exporter:latest"
uid: "0"
gid: "0"
privileged: true
restart: "always"
ports:
- { exposed: "${VM_PORT_EXPORTER_PROXMOX}", container: "9221" }
healthcheck: 'wget --no-verbose --tries=1 --spider http://0.0.0.0:9221/ || exit 1'
environment:
- { name: "PVE_VERIFY_SSL", value: "false" }
- { name: "PYTHONWARNINGS", value: "ignore" }
ressources:
2023-09-26 16:09:27 +00:00
memory: "{{ 1.0 if 1.0 <= vm_os_memory_max|float else vm_os_memory_max|float }}G"
2023-09-26 09:29:37 +00:00
volumes:
- { local: './{{ stack_folder_conf }}/exporters/proxmox/conf/proxmox.yml', container: '/etc/pve.yml', mode: 'ro' }
- name: "exporter-snmp"
extends: "host"
image: "prom/snmp-exporter:latest"
restart: "always"
ports:
- { exposed: "${VM_PORT_EXPORTER_SNMP}", container: "9116" }
command: '--config.file=/etc/snmp_exporter/snmp.yml'
healthcheck: 'wget --no-verbose --tries=1 --spider http://0.0.0.0:9116/ || exit 1'
volumes:
- { local: './{{ stack_folder_conf }}/exporters/snmp/nas.yml', container: '/etc/snmp_exporter/snmp.yml', mode: 'ro' }
- name: "exporter-adguard"
image: "registry.zogg.fr/zogg/adguard-exporter:latest"
uid: "0"
gid: "0"
privileged: true
restart: "always"
ports:
- { exposed: "${VM_PORT_EXPORTER_ADGUARD}", container: "9617" }
healthcheck: '/healthcheck || exit 1'
environment:
- { name: "ADGUARD_PROTOCOL", value: "http" }
- { name: "ADGUARD_HOSTNAME", value: "${VM_HOST}" }
- { name: "ADGUARD_PORT", value: "${VM_PORT_ADGUARDHOME}" }
- { name: "ADGUARD_PASSWORD", value: "/run/secrets/exporter-adguard-password" }
- { name: "PASSWORD_FROM_FILE", value: "true" }
- { name: "INTERVAL", value: "10s" }
- { name: "LOG_LIMIT", value: "10000" }
- { name: "SERVER_PORT", value: "9617" }
volumes:
- { local: './{{ stack_folder_conf }}/exporters/adguard/adguard.yml', container: '/etc/snmp_exporter/snmp.yml', mode: 'ro' }
secrets:
2023-09-26 16:09:27 +00:00
- { name: "exporter-adguard-password", file: "./{{ stack_folder_secrets }}/exporters/adguard/secrets/password.secrets" }
2023-09-26 09:29:37 +00:00
- name: "exporter-nut"
image: "hon95/prometheus-nut-exporter:latest"
uid: "0"
gid: "0"
privileged: true
restart: "always"
ports:
- { exposed: "${VM_PORT_EXPORTER_NUT}", container: "9995" }
healthcheck: 'wget --no-verbose --tries=1 --spider http://0.0.0.0:9995/ || exit 1'
environment:
- { name: "HTTP_PATH", value: "/metrics" }
- name: "exporter-freebox"
image: "registry.zogg.fr/zogg/freebox-exporter:latest"
uid: "0"
gid: "0"
privileged: true
restart: "always"
ports:
- { exposed: "${VM_PORT_EXPORTER_FREEBOX}", container: "10001" }
2023-09-26 16:09:27 +00:00
commands: "-fiber"
2023-09-26 09:29:37 +00:00
healthcheck: '/healthcheck || exit 1'
environment:
- { name: "HOME", value: "token" }
volumes:
- { local: './{{ stack_folder_conf }}/exporters/freebox/datas', container: '/token', mode: 'rw' }
- name: "exporter-redis"
image: "bitnami/redis-exporter:latest"
uid: "0"
gid: "0"
privileged: true
restart: "always"
ports:
- { exposed: "${VM_PORT_EXPORTER_REDIS}", container: "9121" }
healthcheck: 'redis_exporter --version || exit 1'
environment:
- { name: "REDIS_ADDR", value: "${MASTER_HOST}:${VM_PORT_REDIS}" }
tmpfs: 512M
- name: "exporter-postgres"
image: "bitnami/postgres-exporter:latest"
uid: "0"
gid: "0"
privileged: true
restart: "always"
ports:
- { exposed: "${VM_PORT_EXPORTER_POSTGRES}", container: "9187" }
healthcheck: 'postgres_exporter --version || exit 1'
environment:
- { name: "DATA_SOURCE_URI", value: "${MASTER_HOST}:${VM_PORT_POSTGRESQL}?sslmode=disable" }
- { name: "DATA_SOURCE_USER_FILE", value: "/run/secrets/exporter-postgres-datasource-user" }
- { name: "DATA_SOURCE_PASS_FILE", value: "/run/secrets/exporter-postgres-datasource-password" }
- { name: "PG_EXPORTER_AUTO_DISCOVER_DATABASES", value: "true" }
tmpfs: 512M
secrets:
2023-09-26 16:09:27 +00:00
- { name: "exporter-postgres-datasource-user", file: "./{{ stack_folder_secrets }}/exporters/postgres/secrets/user.secrets" }
- { name: "exporter-postgres-datasource-password", file: "./{{ stack_folder_secrets }}/exporters/postgres/secrets/password.secrets" }
2023-09-26 09:29:37 +00:00
- name: "exporter-mysql"
image: "bitnami/mysqld-exporter:latest"
uid: "0"
gid: "0"
privileged: true
restart: "always"
ports:
- { exposed: "${VM_PORT_EXPORTER_MYSQL}", container: "9104" }
commands:
- "--config.my-cnf=/mysql.cnf"
- "--tls.insecure-skip-verify"
- "--collect.auto_increment.columns"
- "--collect.binlog_size"
- "--collect.engine_innodb_status"
#- "--collect.engine_tokudb_status"
- "--collect.info_schema.innodb_metrics"
- "--collect.info_schema.innodb_tablespaces"
- "--collect.info_schema.innodb_cmp"
- "--collect.info_schema.innodb_cmpmem"
- "--collect.info_schema.processlist"
- "--collect.info_schema.replica_host"
- "--collect.info_schema.tables"
- "--collect.info_schema.tables.databases='*'"
- "--collect.mysql.user"
- "--collect.perf_schema.eventsstatements"
- "--collect.perf_schema.eventsstatementssum"
- "--collect.perf_schema.eventswaits"
- "--collect.perf_schema.file_events"
- "--collect.perf_schema.file_instances"
- "--collect.perf_schema.indexiowaits"
- "--collect.perf_schema.memory_events"
- "--collect.perf_schema.tableiowaits"
- "--collect.perf_schema.tablelocks"
- "--collect.perf_schema.replication_group_members"
- "--collect.perf_schema.replication_group_member_stats"
- "--collect.perf_schema.replication_applier_status_by_worker"
healthcheck: 'mysqld_exporter --version || exit 1'
environment:
- { name: "MYSQLD_EXPORTER_PASSWORD_FILE", value: "/run/secrets/exporter-mysql-password" }
tmpfs: 512M
volumes:
- { local: './{{ stack_folder_conf }}/exporters/mysql/mysql.cnf', container: '/mysql.cnf', mode: 'ro' }
secrets:
2023-09-26 16:09:27 +00:00
- { name: "exporter-mysql-password", file: "./{{ stack_folder_secrets }}/exporters/mysql/secrets/password.secrets" }
2023-09-26 09:29:37 +00:00
- name: "exporter-mariadb"
image: "bitnami/mysqld-exporter:latest"
uid: "0"
gid: "0"
privileged: true
restart: "always"
ports:
- { exposed: "${VM_PORT_EXPORTER_MARIADB}", container: "9104" }
commands:
- "--config.my-cnf=/mariadb.cnf"
#- "--collect.auto_increment.columns"
- "--collect.binlog_size"
- "--collect.engine_innodb_status"
#- "--collect.engine_tokudb_status"
##- "--collect.info_schema.innodb_metrics"
#- "--collect.info_schema.innodb_tablespaces"
- "--collect.info_schema.innodb_cmp"
- "--collect.info_schema.innodb_cmpmem"
#- "--collect.info_schema.processlist"
#- "--collect.info_schema.replica_host"
- "--collect.info_schema.tables"
- "--collect.info_schema.tables.databases='*'"
- "--collect.mysql.user"
- "--collect.perf_schema.eventsstatements"
#- "--collect.perf_schema.eventsstatementssum"
- "--collect.perf_schema.eventswaits"
- "--collect.perf_schema.file_events"
- "--collect.perf_schema.file_instances"
- "--collect.perf_schema.indexiowaits"
- "--collect.perf_schema.memory_events"
- "--collect.perf_schema.tableiowaits"
- "--collect.perf_schema.tablelocks"
#- "--collect.perf_schema.replication_group_members"
#- "--collect.perf_schema.replication_group_member_stats"
#- "--collect.perf_schema.replication_applier_status_by_worker"
healthcheck: 'mysqld_exporter --version || exit 1'
environment:
- { name: "MYSQLD_EXPORTER_PASSWORD_FILE", value: "/run/secrets/exporter-mariadb-password" }
tmpfs: 512M
volumes:
- { local: './{{ stack_folder_conf }}/exporters/mariadb/mariadb.cnf', container: '/mariadb.cnf', mode: 'ro' }
secrets:
2023-09-26 16:09:27 +00:00
- { name: "exporter-mariadb-password", file: "./{{ stack_folder_secrets }}/exporters/mariadb/secrets/password.secrets" }
2023-09-26 09:29:37 +00:00
- name: "exporter-mailcow"
image: "thej6s/mailcow-exporter:latest"
uid: "0"
gid: "0"
privileged: true
restart: "always"
ports:
- { exposed: "${VM_PORT_EXPORTER_MAILCOW}", container: "9099" }
healthcheck: 'mailcow-exporter -h || exit 1'