Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/frdmn/docker-speedtest-grafana
🚢📦Grafana + InfluxDB + Speedtest.net results
https://github.com/frdmn/docker-speedtest-grafana
Last synced: 12 days ago
JSON representation
🚢📦Grafana + InfluxDB + Speedtest.net results
- Host: GitHub
- URL: https://github.com/frdmn/docker-speedtest-grafana
- Owner: frdmn
- License: mit
- Created: 2018-07-08T20:19:07.000Z (over 6 years ago)
- Default Branch: dev
- Last Pushed: 2023-06-14T16:14:48.000Z (over 1 year ago)
- Last Synced: 2024-04-14T01:04:48.499Z (7 months ago)
- Language: JavaScript
- Homepage:
- Size: 71.3 KB
- Stars: 201
- Watchers: 15
- Forks: 70
- Open Issues: 22
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# docker-speedtest-grafana
![](https://i.imgur.com/cvfhIDH.png)
Docker setup consisting out of Grafana incl. a pre-configured dashboard, InfluxDB and a [speedtest.net CLI test](https://www.speedtest.net/apps/cli) runner.
## Installation
1. Make sure you've installed all requirements
2. Clone this repository:```shell
git clone https://github.com/frdmn/docker-speedtest-grafana
```3. Create a copy of the sample `.env` file and adjust it at will:
```shell
cp .env.sample .env
```4. Spin up the containers:
```shell
docker-compose up -d
```## Configuration
You can make use of the following environment variables / configurations:
| Environment variable | Default value | Description
|----------------------|---------------|------------|
| `GRAFANA_PORT` | `3000` | Port to bind Grafana webinterface on the host system |
| `SPEEDTEST_SPEEDTEST_INTERVAL` | `3600` | Interval/pause (in seconds) between speedtests |
| `SPEEDTEST_HOST` | `local` | Display name of the client |
| `SPEEDTEST_SERVER` | none | Optionally set specific speedtest.net server ID, otherwise use the closest |
| `INFLUXDB_DB` | `speedtest` | Database to save speedtest results |
| `INFLUXDB_HOST` | `influxdb` | Name of the InfluxDB host/containers |
| `INFLUXDB_USERNAME` | `root` | Username for InfluxDB authentication |
| `INFLUXDB_PASSWORD` | `root` | Password for InfluxDB authentication |## Usage
### Services
#### Start/create services
```shell
$ docker-compose up -d
Creating speedtest_influxdb_1 ... done
Creating speedtest_grafana_1 ... done
Creating speedtest_speedtest_1 ... done
```#### Stop services
```shell
$ docker-compose stop
Stopping speedtest_influxdb_1 ... done
Stopping speedtest_grafana_1 ... done
Stopping speedtest_speedtest_1 ... done
```#### Upgrade services
```shell
$ docker-compose stop
$ docker-compose pull
$ docker-compose rm
$ docker-compose up -d
```#### Check logs
```shell
$ docker-compose logs -f
``````shell
$ docker-compose logs -f grafana
```### Grafana
#### Dashboard
By default the dashboard shows all speedtest results. To filter for a specifc host, simply add a `and host = 'local'` statement in the `WHERE` clause of the SQL select.
Example (Download Time Serie):
```
SELECT mean("value") FROM "download" WHERE $timeFilter and host = 'local' GROUP BY time($interval) fill(null)
```#### Administrative access
Access `http://${HOSTNAME}:${GRAFANA_PORT}` ([http://localhost:3000](`http://localhost:3000`) by default) and login using the following default credentials:
* Username: `admin`
* Password: `admin`## Contributing
1. Fork it
2. Create your feature branch:```shell
git checkout -b feature/my-new-feature
```3. Commit your changes:
```shell
git commit -am 'Add some feature'
```4. Push to the branch:
```shell
git push origin feature/my-new-feature
```5. Submit a pull request
## Requirements / Dependencies
* Docker (incl. `docker-compose`)
## Version
1.0.0
## License
[MIT](LICENSE)