Private GIT

Skip to content
Snippets Groups Projects
Commit 2e32afbe authored by breadlysm's avatar breadlysm
Browse files

Updated to use ENV Vars

parent 06913085
Branches
No related tags found
No related merge requests found
import time
import json
import subprocess
import os
from influxdb import InfluxDBClient
# InfluxDB Settings
DB_ADDRESS = 'db_hostname.network'
DB_PORT = 8086
DB_USER = 'db_username'
DB_PASSWORD = 'db_password'
DB_DATABASE = 'speedtest_db'
DB_ADDRESS = os.environ.get('INFLUX_DB_ADDRESS')
DB_PORT = os.environ.get('INFLUX_DB_PORT')
DB_USER = os.environ.get('INFLUX_DB_USER')
DB_PASSWORD = os.environ.get('INFLUX_DB_PASSWORD')
DB_DATABASE = os.environ.get('INFLUX_DB_DATABASE')
# Speedtest Settings
TEST_INTERVAL = 1800 # Time between tests (in seconds).
TEST_FAIL_INTERVAL = 60 # Time before retrying a failed Speedtest (in seconds).
TEST_INTERVAL = os.environ.get('SPEEDTEST_INTERVAL') # Time between tests (in seconds).
TEST_FAIL_INTERVAL = os.environ.get('SPEEDTEST_FAIL_INTERVAL') # Time before retrying a failed Speedtest (in seconds).
influxdb_client = InfluxDBClient(
DB_ADDRESS, DB_PORT, DB_USER, DB_PASSWORD, None)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment