Skip to content

Commit 8fbb64e

Browse files
Merge pull request #25 from plaintextpackets/data_persist_issue
Data persist issue
2 parents 6ed3f38 + eda4a07 commit 8fbb64e

File tree

3 files changed

+82
-7
lines changed

3 files changed

+82
-7
lines changed

README.md

Lines changed: 71 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,19 @@
22

33
Simple and effective tool for measuring ISP performance at home. The tool measures several performance metrics including packet loss, latency, jitter, and DNS performance. It also aggregates these metrics into a common score, which you can use to monitor overall health of your internet connection.
44

5+
## Support the Project
6+
7+
If you'd like to support the development of this project, feel free to buy me a coffee!
8+
9+
https://buymeacoffee.com/plaintextpm
10+
11+
## Full Tutorial
12+
13+
Visit YouTube for a full tutorial on how to install and use Netprobe:
14+
15+
https://youtu.be/Wn31husi6tc
16+
17+
518
## Requirements and Setup
619

720
To run Netprobe Lite, you'll need a PC running Docker connected directly to your ISP router. Specifically:
@@ -59,24 +72,76 @@ DNS_NAMESERVER_4_IP="8.8.8.8" # Replace this IP with the DNS server you use at h
5972

6073
Change 8.8.8.8 to the IP of the DNS server you use, then restart the application (docker compose down / docker compose up)
6174

62-
### Data storage
75+
### Data storage - default method
6376

64-
By default, Docker will store the data collected in a volume, which will persist between restarts.
77+
By default, Docker will store the data collected in several Docker volumes, which will persist between restarts.
6578

66-
To clear out old data, you need to first delete the Prometheus container:
79+
They are:
6780

6881
```
69-
docker rm netprobe-prometheus
82+
netprobe_lite_grafana_data (used to store Grafana user / pw)
83+
netprobe_lite_prometheus_data (used to store time series data)
7084
```
7185

72-
Then prune the docker volumes:
86+
To clear out old data, you need to stop the app and remove these volumes:
7387

7488
```
75-
docker volume prune
89+
docker compose down
90+
docker volume rm netprobe_lite_grafana_data
91+
docker volume rm netprobe_lite_prometheus_data
7692
```
7793

7894
When started again the old data should be wiped out.
7995

96+
### Data storage - bind mount method
97+
98+
Using the default method, the data is stored within Docker volumes which you cannot easily access from the host itself. If you'd prefer storing data in mapped folders from the host, follow these instructions (thank you @Jeppedy):
99+
100+
1. Clone the repo
101+
102+
2. Inside the folder create two directories:
103+
104+
```
105+
mkdir -p data/grafana data/prometheus
106+
```
107+
108+
3. Modify the compose.yml as follows (volume path as well as adding user ID):
109+
110+
```
111+
prometheus:
112+
restart: always
113+
container_name: netprobe-prometheus
114+
image: "prom/prometheus"
115+
volumes:
116+
- ./config/prometheus/prometheus.yml:/etc/prometheus/prometheus.yml
117+
- ./data/prometheus:/prometheus # modify this to map to the folder you created
118+
119+
command:
120+
- '--config.file=/etc/prometheus/prometheus.yml'
121+
- '--storage.tsdb.path=/prometheus'
122+
networks:
123+
- custom_network # Attach to the custom network
124+
user: "1000" # set this to the desired user with correct permissions to the bind mount
125+
126+
grafana:
127+
restart: always
128+
image: grafana/grafana-enterprise
129+
container_name: netprobe-grafana
130+
volumes:
131+
- ./config/grafana/datasources/automatic.yml:/etc/grafana/provisioning/datasources/automatic.yml
132+
- ./config/grafana/dashboards/main.yml:/etc/grafana/provisioning/dashboards/main.yml
133+
- ./config/grafana/dashboards/netprobe.json:/var/lib/grafana/dashboards/netprobe.json
134+
- ./data/grafana:/var/lib/grafana # modify this to map to the folder you created
135+
ports:
136+
- '3001:3000'
137+
networks:
138+
- custom_network # Attach to the custom network
139+
user: "1000" # set this to the desired user with correct permissions to the bind mount
140+
```
141+
142+
4. Remove the volumes section from compose.yml
143+
144+
80145
### Run on startup
81146

82147
To configure the tool to work as a daemon (run on startup, keep running), edit 'compose.yml' and add the following to each service:

compose.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@ services:
4545
image: "prom/prometheus"
4646
volumes:
4747
- ./config/prometheus/prometheus.yml:/etc/prometheus/prometheus.yml
48+
- prometheus_data:/prometheus # Persistent local storage for Prometheus data
49+
command:
50+
- '--config.file=/etc/prometheus/prometheus.yml'
51+
- '--storage.tsdb.path=/prometheus'
4852
networks:
4953
- custom_network # Attach to the custom network
5054

@@ -56,7 +60,13 @@ services:
5660
- ./config/grafana/datasources/automatic.yml:/etc/grafana/provisioning/datasources/automatic.yml
5761
- ./config/grafana/dashboards/main.yml:/etc/grafana/provisioning/dashboards/main.yml
5862
- ./config/grafana/dashboards/netprobe.json:/var/lib/grafana/dashboards/netprobe.json
63+
- grafana_data:/var/lib/grafana
5964
ports:
6065
- '3001:3000'
6166
networks:
6267
- custom_network # Attach to the custom network
68+
69+
volumes:
70+
prometheus_data:
71+
grafana_data:
72+

config/grafana/dashboards/netprobe.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -477,7 +477,7 @@
477477
"axisSoftMin": 0,
478478
"barAlignment": 0,
479479
"drawStyle": "line",
480-
"fillOpacity": 100,
480+
"fillOpacity": 0,
481481
"gradientMode": "none",
482482
"hideFrom": {
483483
"legend": false,

0 commit comments

Comments
 (0)