Add Hostname writing

This commit is contained in:
Marty Oehme 2021-05-19 16:23:26 +02:00
parent f412d31d1c
commit aa91c8668d
Signed by: Marty
GPG key ID: B7538B8F50A1C800

View file

@ -8,8 +8,11 @@ from multiprocessing import Process
from influxdb_client import InfluxDBClient, Point, WritePrecision from influxdb_client import InfluxDBClient, Point, WritePrecision
from influxdb_client.client.write_api import SYNCHRONOUS from influxdb_client.client.write_api import SYNCHRONOUS
# InfluxDB Settings # Categorization Settings
NAMESPACE = os.getenv("NAMESPACE", "None") NAMESPACE = os.getenv("NAMESPACE", "None")
HOSTNAME = os.getenv("HOSTNAME")
# InfluxDB Settings
DB_ADDRESS = os.getenv("INFLUX_DB_ADDRESS", "influxdb:8086") DB_ADDRESS = os.getenv("INFLUX_DB_ADDRESS", "influxdb:8086")
DB_TOKEN = os.getenv("INFLUX_DB_TOKEN", "") DB_TOKEN = os.getenv("INFLUX_DB_TOKEN", "")
DB_ORG = os.getenv("INFLUX_DB_ORG", "speed-org") 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 takes in _data and attaches CLIoutput to more readable ids
tag_switch = { tag_switch = {
"host": HOSTNAME,
"namespace": NAMESPACE, "namespace": NAMESPACE,
"isp": data["isp"], "isp": data["isp"],
"interface": data["interface"]["name"], "interface": data["interface"]["name"],