Commit 5b1aef3d authored by Nikita Yurishev's avatar Nikita Yurishev

added connection to the influxdb, not lokalhost

parent 92faa681
......@@ -5,7 +5,7 @@ import time
class InfluxConnection:
def __init__(self):
# Конфиги
self.INFLUXDB_URL = 'http://localhost:8086'
self.INFLUXDB_URL = 'http://influxdb.k8s.eterfund.ru'
self.INFLUXDB_DB = ''
self.INFLUXDB_USER = ''
self.INFLUXDB_PASSWORD = ''
......@@ -13,8 +13,8 @@ class InfluxConnection:
# Разделение URL на хост и порт
url_parts = self.INFLUXDB_URL.split('://')[1].split(':')
host = url_parts[0]
port = int(url_parts[1]) if len(url_parts) > 1 else 8086
#port = int(url_parts[1]) if len(url_parts) > 1 else 8086
port = 80
# Подключение к InfluxDB
self.client = InfluxDBClient(
host=host,
......@@ -25,7 +25,7 @@ class InfluxConnection:
)
# Создание базы данных (если её нет)
self.client.create_database(self.INFLUXDB_DB)
#self.client.create_database(self.INFLUXDB_DB)
def write_data(self, sensor_id, values):
json_body = [
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment