xperimental / netatmo-exporter

Prometheus exporter for Netatmo sensor data.
MIT License
45 stars 18 forks source link

Add docker-compose example #6

Open herver opened 6 years ago

herver commented 6 years ago

Could be useful for some people deploying this exporter with docker-compose (maybe in conjunction with prometheus and grafana)

tom-43 commented 1 year ago

Docker Compose step by step installation

I wrote a little tutorial on how to create all the containers that are needed using Docker Compose and the new Netatmo authentication:

  1. Create a folder on your system for the Docker containers:

    sudo mkdir /docker
    sudo mkdir /docker/grafana
    sudo mkdir /docker/prometheus
    sudo mkdir /docker/netatmo-exporter
  2. Create the file prometheus.yml so that Prometheus can retrieve your data:

    sudo nano /docker/prometheus/prometheus.yml
  3. Add the following content to the prometheus.yml file:

    
    global:
    scrape_interval: 5s
    external_labels:
    monitor: 'codelab-monitor'

scrape_configs:

  1. Create the docker-compose.yml file:

    sudo nano /docker/netatmo-exporter/docker-compose.yml
  2. Add the following content to the docker-compose.yml file and don't forget to add your Netatmo client ID, client secret and server IP:

    
    version: '3'

services: prometheus: image: prom/prometheus:latest volumes:

volumes: grafana_data: driver: local

networks: netatmo-network: driver: bridge ipam: config:

  1. Open the Netatmo-exporter folder and execute the following command to start all containers:

    sudo cd /docker/netatmo-exporter
    sudo docker compose up -d
  2. Open http://yourserverip:9210 and click on authorizing here and accept that your data may be retrieved:

Bildschirmfoto 2023-07-21 um 11 22 50

Bildschirmfoto 2023-07-21 um 11 23 26

  1. Restart the container:
    docker restart netatmo-exporter-netatmo-exporter1

Now you have Netatmo Exporter, Prometheus and Grafana installed to display your Netatmo weather data. Also, with Watchtower all containers are automatically updated when there is a new version.

Grafana can be reached at http://yourserverip:3000.

To add the data to a Grafana dashboard you first need to add Prometheus as a data source. The ip for this is: 172.20.20.3