Skip to content

Commit ea8e710

Browse files
Changes to accomodate speedtest
1 parent 351f30c commit ea8e710

File tree

9 files changed

+231
-126
lines changed

9 files changed

+231
-126
lines changed

.env

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,15 +43,13 @@ threshold_dns_latency = "100" # 100ms dns latency threshold as max
4343
# - This configuration is for setting up a "speed test" or rather a test of your internet bandwidth.
4444
# - In order to test your upload and download bandwidth we use speedtest.net as source. So your client will connect there and upload and download some data.
4545
# - That also means that a random server is selected for the test (usually the nearest one)
46-
SPEEDTEST_ENABLED="False" # set this to "True" to enable bandwidth test at all
47-
SPEEDTEST_INTERVAL_MULTIPLIER="60" # multiplier for the test to be executed because you probably don't want to constantly test your download speed (will be a multiple of "PROBE_INTERVAL") so defaults to 30 minutes
46+
# - Setting the SPEEDTEST_INTERVAL too agressively will cause speedtest.net to block your requests, recommend 15 minutes (900 seconds) and above
47+
SPEEDTEST_ENABLED="True" # set this to "True" to enable speed test function
48+
SPEEDTEST_INTERVAL="937" # interval on which the speedtest will run, in seconds - note using a prime number helps reduce the number of collisions between netprobe and speed tests
4849

4950

5051
# SYSTEM VARIABLES - DO NOT TOUCH
5152

52-
DEVICE_ID="44c42e36-f2eb-44d0-babc-1a749498e016"
53-
SITE_ID="f0ac2f33-1a20-471d-b430-d905900e0e71"
54-
5553
PRESENTATION_PORT = "5000"
5654
PRESENTATION_INTERFACE = "0.0.0.0"
5755

compose.yml

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,28 +14,51 @@ services:
1414
- ./config/redis/redis.conf:/etc/redis/redis.conf
1515
networks:
1616
- netprobe-net
17+
dns:
18+
- 8.8.8.8
19+
- 8.8.4.4
1720

1821
netprobe:
1922
restart: always
2023
container_name: netprobe-probe
21-
image: "plaintextpackets/netprobe:latest"
24+
image: "plaintextpacket/netprobe:latest"
2225
volumes:
2326
- .:/netprobe_lite
2427
environment:
2528
MODULE: "NETPROBE"
2629
networks:
2730
- netprobe-net
31+
dns:
32+
- 8.8.8.8
33+
- 8.8.4.4
34+
35+
speedtest:
36+
restart: always
37+
container_name: netprobe-speedtest
38+
image: "plaintextpacket/netprobe:latest"
39+
volumes:
40+
- .:/netprobe_lite
41+
environment:
42+
MODULE: "SPEEDTEST"
43+
networks:
44+
- netprobe-net
45+
dns:
46+
- 8.8.8.8
47+
- 8.8.4.4
2848

2949
presentation:
3050
restart: always
3151
container_name: netprobe-presentation
32-
image: "plaintextpackets/netprobe:latest"
52+
image: "plaintextpacket/netprobe:latest"
3353
volumes:
3454
- .:/netprobe_lite
3555
environment:
3656
MODULE: "PRESENTATION"
3757
networks:
3858
- netprobe-net
59+
dns:
60+
- 8.8.8.8
61+
- 8.8.4.4
3962

4063
prometheus:
4164
restart: always
@@ -49,6 +72,9 @@ services:
4972
- '--storage.tsdb.path=/prometheus'
5073
networks:
5174
- netprobe-net
75+
dns:
76+
- 8.8.8.8
77+
- 8.8.4.4
5278

5379
grafana:
5480
restart: always
@@ -63,6 +89,9 @@ services:
6389
- '3001:3000'
6490
networks:
6591
- netprobe-net
92+
dns:
93+
- 8.8.8.8
94+
- 8.8.4.4
6695

6796
volumes:
6897
prometheus_data:

config/__init__.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,9 @@ class Config_Netprobe():
1515
probe_interval = int(os.getenv('PROBE_INTERVAL'))
1616
probe_count = int(os.getenv('PROBE_COUNT'))
1717
sites = os.getenv('SITES').split(',')
18-
device_id = os.getenv('DEVICE_ID')
19-
site_id = os.getenv('SITE_ID')
2018
dns_test_site = os.getenv('DNS_TEST_SITE')
2119
speedtest_enabled = os.getenv("SPEEDTEST_ENABLED", 'False').lower() in ('true', '1', 't')
22-
speedtest_interval_multiplier = int(os.getenv('SPEEDTEST_INTERVAL_MULTIPLIER'))
20+
speedtest_interval = int(os.getenv('SPEEDTEST_INTERVAL'))
2321

2422
DNS_NAMESERVER_1 = os.getenv('DNS_NAMESERVER_1')
2523
DNS_NAMESERVER_1_IP = os.getenv('DNS_NAMESERVER_1_IP')

0 commit comments

Comments
 (0)