A simple tool to monitor your internet speed.
You want to measure and keep track of your internet performance.
A simple script measures the speed (download,upload and latency) and saves the result in a database. A Grafana Dashboard then visualizes the data.
First rename the file dummy.env
into .env
and fill in your secrets.
Build and install the tool:
git clone git@github ...
cd isp-mon
docker-compose up
Once the containers are launched, visit http://localhost:3000. Log in using the username admin
and password admin
. In the menu on the lefhand side add a new data source.
Choose MySql, with the host db
, the port 3306
, the user grafanaReader
with the password readOnly
and save the data source.
Now a new dashboard can be added. By using the query builder, a lot of different vizualizations can be easily added to the dashboard. Alternatively the dashboard defined in dashboard.json
can be imported.
Create a new MySql database (using the X Protocol) and initialize it with the schema.sql
schema, then adjust the respective variables in the .env
file.
Grafana can be initialized in the same way as when using docker-compose
.
Either use the Dockerfile to build a standalone image for the speed tests or install the script without docker.
First install the speedtest-cli
and fast-cli
speedtests, then install and start measuring:
npm install
npm run start
-
Build
docker build -t measure .
-
Start (starts measuring)
docker run -dit --name measure --env_file .env measure
-
(Optional) Connect to the container
docker exec -it measure bash
If the database runs on a Docker container on the same host, either point to the database using the local IP of the host, or better create a shared Docker network for both containers.
Note that a new MySql user with SELECT
privileges and a default password is created for Grafana in the schema.sql
. While this account has read only access, if you are exposing your database to the internet you may want to change the password.