Giter Club home page Giter Club logo

opendtu-grafana-stack's Introduction

Mosquitto-Telegraf-Influx-Grafana Stack

Check compose file License

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)

Prequesites

  • The following ports must be open on host (so if you have a firewall unblock these ports)
    • 3000 for grafana (webinterface)
    • 8883 or 1883 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)

How to use it

  1. Clone the repo
    git clone https://github.com/Kraego/OpenDTU-Grafana-Stack.git   
    
  2. Go to directory where you have cloned the repo
    cd OpenDTU-Grafana-Stack
    
  3. 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
  4. Run the init script:
     ./init.sh
    
  5. Start up the whole stack
    docker-compose up -d
    
  6. Open grafana: http://localhost:3000

YOUR DONE

SELinux

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

Lets encrypt certs

  • Install Certbot on your Host
    • update [YOUR DOMAIN] and [DIR MOUNT OF MOSQUITTO CONTAINER ON HOST] (./mosquitto/certs) in mosquitto-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)

opendtu-grafana-stack's People

Contributors

kraego avatar muellerbe avatar jenskueper avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.