Docker and OS Metrics for Raspberry Pi

Dashboard

Dashboard with details of the container and host OS metrics for Raspberry Pi by Oijkn.
Last updated: 5 months ago

Start with Grafana Cloud and the new FREE tier. Includes 10K series Prometheus or Graphite Metrics and 50gb Loki Logs

Downloads: 214

Reviews: 0

  • screencapture-192-168-1-100-1013-d-Ss3q6hSZk-docker-and-os-metrics-for-raspberry-pi-2021-10-17-14_32_37.png
    screencapture-192-168-1-100-1013-d-Ss3q6hSZk-docker-and-os-metrics-for-raspberry-pi-2021-10-17-14_32_37.png

Docker-Raspberry-PI-Monitoring

Introduction

A monitoring solution for Docker hosts and containers with Prometheus, Grafana, cAdvisor, NodeExporter.

Please visit my Github for all details.

Screenshot

image

Installation

First SSH into your Pi and there is one thing we need to do before we get cracking. We need to enable c-groups so the stack will work out of the box. To do this you need to modify the configuration file /boot/cmdline.txt:

sudo nano /boot/cmdline.txt

And add the following options:

cgroup_enable=memory cgroup_memory=1

Now save the file in your editor and reboot:

sudo reboot

Then clone this repository on your Pi host, cd into Docker-Raspberry-PI-Monitoring directory and run docker-compose up:

git clone https://github.com/oijkn/Docker-Raspberry-PI-Monitoring.git
cd Docker-Raspberry-PI-Monitoring
docker-compose up -d

Containers:

  • Prometheus (metrics database) http://<host-ip>:9090
  • Grafana (visualize metrics) http://<host-ip>:3000
  • NodeExporter (host metrics collector)
  • cAdvisor (containers metrics collector)

Setup Grafana

Navigate to http://<host-ip>:3000 and login with user admin password admin. You can change the credentials in the compose file or by supplying the ADMIN_USER and ADMIN_PASSWORD environment variables on compose up.

GF_SECURITY_ADMIN_USER=admin
GF_SECURITY_ADMIN_PASSWORD=changeme
GF_USERS_ALLOW_SIGN_UP=false

Grafana is not preconfigured with dashboard, so you have to import it from the json file. And set Prometheus as the default data source.

Grafana > Configuration > Data Sources > Prometheus

image

Setup Prometheus

scrape_configs:
  - job_name: 'prometheus'
    scrape_interval: 30s
    static_configs:
      - targets: ['localhost:9090', 'cadvisor:8080', 'node-exporter:9100']
Get this dashboard:
15120
Dependencies: