On this post I will explain how I set up a Grafana + Prometheus into a RaspberryPi with Raspbian.

Here it’s a little design where explains how it is the implementation I did:

🔵 Server: RaspberryPi 3B+

  • Services to install(server side):
    1. Grafana
    2. Prometheus (Metric collector and database)
    3. Node Exporter (collector worker)

🟢 Clients: Raspberrypi Zero Fedora Workstation Debian VPS

  • Services to install(client side):
    1. Node Exporter (collector worker).

🔵 Lets start from the server side.

  • Installing Prometheus.

NOTE: please go to the download section and pick up the right model of your processor. In my case is armv7

$ wget https://github.com/prometheus/prometheus/releases/download/v2.22.0/prometheus-2.22.0.linux-armv7.tar.gz
$ tar xfz prometheus-2.24.0.linux-armv7.tar.gz
$ rm prometheus-2.24.0.linux-armv7.tar.gz
$ mv prometheus-2.24.0.linux-armv7 prometheus

Create the service [systemd]

$ sudo nano /etc/systemd/system/prometheus.service

Into the service we have:

[Unit]
Description=Prometheus Server
Documentation=https://prometheus.io/docs/introduction/overview/
After=network-online.target

[Service]
User=pi

ExecStart=/usr/local/bin/prometheus/prometheus \
  --config.file=/usr/local/bin/prometheus/prometheus.yml \
  --storage.tsdb.path=/usr/local/bin/prometheus/data \
  --web.enable-admin-api \
  --web.listen-address=:9090

[Install]
WantedBy=multi-user.target

Keep on mind the “prometheus.yml” file it’s where we need to config our prometheus

$ sudo systemctl daemon-reload
$ sudo systemctl enable prometheus.service
$ sudo systemctl start prometheus.service
  • Installing Node Export

Go to the official download page and pick up your model here

…To be continue…