This is a docker stack created to visualize the topics of a opendDTU (https://github.com/tbnobody/OpenDTU). The data from openDTU is transferred over mqtt with basic auth an let's encrypt certificates. The data will be stored up to five years. Basically it is the dockerized version of https://github.com/Kraego/OpenDTU-Grafana-Howto. When used with something different adapt the telegraf mapping to your scenario.
It consists of:
mosquitto
(mqtt broker)telegraf
(mqtt -> influxDB2)influxDB2
(store the timeframes in buckets)grafana
(monitoring)
- The following ports must be open on host (so if you have a firewall unblock these ports)
3000
for grafana (webinterface)8883
or1883
for mqtt broker (to receive publishes from openDTU)
- on mac os install gsed for example with brew
- if you want the tls cert stuff uncomment line 6-8 in the
mosquitto.conf
(see this guide how to install certbot on host OS)
- Clone the repo
git clone https://github.com/Kraego/OpenDTU-Grafana-Stack.git
- Go to directory where you have cloned the repo
cd OpenDTU-Grafana-Stack
- Create a
.env
file from the template- rename
.env_template
to.env
- configure the variables with your values, INFLUX_TOKEN will be set automatic during init
- rename
- Run the init script:
./init.sh
- Start up the whole stack
docker-compose up -d
- Open grafana: http://localhost:3000
- Use the credentials configured in the .env file
- Add or create Dashboards (for opendtu see: https://github.com/Kraego/OpenDTU-Grafana-Howto)
YOUR DONE
If you have SELinux installed and running, add :Z
to all volumes
entries in docker-compose.yaml
, e.g.
volumes:
- ./influxdb/data:/var/lib/influxdb2:Z
- Install
Certbot
on your Host- update
[YOUR DOMAIN]
and[DIR MOUNT OF MOSQUITTO CONTAINER ON HOST]
(./mosquitto/certs) inmosquitto-copy-certs.sh
- copy the file
mosquitto-copy-certs.sh
to your certbot renewal hooks dir (on Linux it is: /etc/letsencrypt/renewal-hooks/deploy) and make it executable (chmod +x mosquitto-copy-certs.sh
)
- update