From aa91c8668d43f5a771468949b434823d360e749c Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Wed, 19 May 2021 16:23:26 +0200 Subject: [PATCH] Add Hostname writing --- main.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/main.py b/main.py index acb5cf2..288732a 100755 --- a/main.py +++ b/main.py @@ -8,8 +8,11 @@ from multiprocessing import Process from influxdb_client import InfluxDBClient, Point, WritePrecision from influxdb_client.client.write_api import SYNCHRONOUS -# InfluxDB Settings +# Categorization Settings NAMESPACE = os.getenv("NAMESPACE", "None") +HOSTNAME = os.getenv("HOSTNAME") + +# InfluxDB Settings DB_ADDRESS = os.getenv("INFLUX_DB_ADDRESS", "influxdb:8086") DB_TOKEN = os.getenv("INFLUX_DB_TOKEN", "") DB_ORG = os.getenv("INFLUX_DB_ORG", "speed-org") @@ -56,6 +59,7 @@ def tag_selection(data): # tag_switch takes in _data and attaches CLIoutput to more readable ids tag_switch = { + "host": HOSTNAME, "namespace": NAMESPACE, "isp": data["isp"], "interface": data["interface"]["name"],