From 3c666a0c22fb08b7d617480a9866abc0b2b4e3da Mon Sep 17 00:00:00 2001 From: timo Date: Fri, 26 Jan 2024 20:21:41 +0100 Subject: [PATCH 1/3] =?UTF-8?q?Mise=20=C3=A0=20jour=20conf=20telegraf?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Conf pour la version 1.29.2 --- telegraf.conf | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/telegraf.conf b/telegraf.conf index e37f8cf..a954d97 100644 --- a/telegraf.conf +++ b/telegraf.conf @@ -19,17 +19,11 @@ # Configuration for sending metrics to InfluxDB -[[outputs.influxdb]] +[[outputs.influxdb_v2]] urls = ["${INFLUXDB_URL}"] - database = "${INFLUXDB_DATABASE}" - database_tag = "" - skip_database_creation = $INFLUXDB_SKIP_DATABASE_CREATION - retention_policy = "" - write_consistency = "any" - timeout = "30s" - username = "${INFLUXDB_USERNAME}" - password = "${INFLUXDB_PASSWORD}" - + token = "${INFLUXDB_TOKEN}" + organization = "${INFLUXDB_ORG}" + bucket = "${INFLUXDB_BUCKET}" ############################################################################### # INPUT PLUGINS # ############################################################################### -- 2.49.1 From f434ae13fdae0febee2b710e090211f37a0b0111 Mon Sep 17 00:00:00 2001 From: timo Date: Fri, 26 Jan 2024 20:22:49 +0100 Subject: [PATCH 2/3] =?UTF-8?q?Image=20telegraf=201.29.2=20+=20d=C3=A9pend?= =?UTF-8?q?ance=20pip3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index 9e1e727..301919a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM telegraf:1.27.1 +FROM telegraf:1.29.2 # Install required packages RUN apt-get update \ @@ -10,12 +10,15 @@ RUN apt-get update \ gnupg-agent \ software-properties-common \ python3-distutils \ - && curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py \ - && python3 get-pip.py --prefix=/usr/local \ - && python3 -m pip install requests \ - && pip install unidecode \ + python3-pip \ + python3-full + +# Installation module necessaire pour le script python +RUN pip3 install requests --break-system-packages \ + && pip3 install unidecode --break-system-packages \ && rm /entrypoint.sh + ADD --chmod=1755 entrypoint.sh / ADD freebox-monit.py /usr/local/py/ ADD telegraf.conf /etc/telegraf/ -- 2.49.1 From 71862ed5d5f931e2a9a51c677dd44d53a8f365e4 Mon Sep 17 00:00:00 2001 From: timo Date: Fri, 26 Jan 2024 20:26:36 +0100 Subject: [PATCH 3/3] Dockercompose qui embarque les nouvelles variables d'environnement MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fichier qui corresponds à mon besoin avec un influDB 2.7.4 installé séparément. Ce qui va être utile est surtout : - INFLUXDB_URL=http://url_or_ip_infludb:8086 - INFLUXDB_TOKEN=token_of_the_bucket - INFLUXDB_SKIP_DATABASE_CREATION=true - INFLUXDB_ORG=Organisation_of_your_influ - INFLUXDB_BUCKET=Name_of_the_bucket --- docker-compose.yml | 33 +++++++++++---------------------- 1 file changed, 11 insertions(+), 22 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index eb84dc0..1b65c79 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,29 +1,18 @@ version: "3" services: - influxdb: - image: influxdb:1.8 - hostname: influxdb_test - restart: always - environment: - INFLUX_DB: fbx - INFLUXDB_USER: fbx - INFLUXDB_PASSWORD: fbx - fbx_telegraf: - image: uzurka/freebox-telegraf - container_name: container_name + image: freebox-exporter-telegraf:latest + container_name: freebox-exporter hostname: hostname environment: + - TELEGRAF_AGENT_INTERVAL=10s + - TELEGRAF_SCRIPT_TIMEOUT=5s - PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/bin:/sbin:/usr/local:/usr/src - TZ=CET - - INFLUXDB_URL=http://influxdb_container_name:port - - INFLUXDB_DATABASE=fbx - - INFLUXDB_SKIP_DATABASE_CREATION=false - - INFLUXDB_USERNAME=fbx - - INFLUXDB_PASSWORD=fbx - - ARGS=SPHDIWX4 - ports: - - 9125:8125/udp - - 9092:8092/udp - - 9094:8094 - restart: unless-stopped + - INFLUXDB_URL=http://url_or_ip_infludb:8086 + - INFLUXDB_TOKEN=token_of_the_bucket + - INFLUXDB_SKIP_DATABASE_CREATION=true + - INFLUXDB_ORG=Organisation_of_your_influ + - INFLUXDB_BUCKET=Name_of_the_bucket + - ARGS= + restart: unless-stopped \ No newline at end of file -- 2.49.1