RasPi monitoring.fritz.box
The Raspberry Pi node called "monitoring.fritz.box" serves as the central monitoring hub for all the machines in my homelab. To achieve this, I run a stack of Prometheus and Grafana in Docker.
With Prometheus, I can collect system metrics from all the machines in my homelab, including CPU usage, memory usage, disk utilization, and network traffic. This gives me a comprehensive view of the health and performance of my systems, allowing me to identify and address any issues before they become critical. In addition to system metrics, I have also configured Prometheus to collect data about the up/down status of services running on some machines and on the internet.
To visualize and analyze the data collected by Prometheus, I use Grafana, a powerful tool that allows me to create interactive dashboards. This enables me to quickly identify trends, anomalies, and other patterns in my system data, providing valuable insights into the health and performance of my homelab.
Metric | Value |
---|---|
Model |
Raspberry Pi 4 Model B |
Install
Operating System
Use the Raspberry Pi Imager to install "Ubuntu Server 23.04 (64-bit)" onto a SD card. Use the following settings:
Make sure to enter a valid hostname and user sebastian uses the correct password!
|
Configuration and package installation
-
Steps to run on you normal workstation (= a machine with SSH access to the RasPi node which is probably the ony you used to setup the SD card)
-
Enable passwordless SSH connections:
ssh sebastian@monitoring.fritz.box
andssh-copy-id sebastian@monitoring.fritz.box
or by using the Jarvis modules ssh-connect-setup-passwordless and ssh-connect (all from your workstation, not on the RasPi node). -
Apply ansible configs from this repo (
src/main/homelab/ansible-cli.sh
)
-
-
FritzBox Settings
-
It is recommended to always assign the same IP address to this RasPi node. This can help avoid issues with IP address conflicts or changes that could cause the communication between services to fail or become unreliable.
-
This machine is not intended for development purposes so there is no need to push any data to Github. Therefore there is no SSH key configuration for GitHub on this machine. It is only possible to clone public repositories via HTTPS. |
Start Services
Docker Compose Stack: Ops
The ops
Docker stack is a Docker Compose configuration that manages all of the needed exporters to monitor system metrics with Prometheus and Grafana. Additionally, it starts a local Portainer instance. By using the Ops Docker stack, you can quickly and easily deploy all of the necessary components for monitoring your system metrics. This includes exporters for various system metrics, such as CPU usage, disk usage, and network activity. The local Portainer instance makes it easy to manage and monitor the Docker containers running in the Ops Docker stack.
Connect via SSH and start the stack by using ~/work/repos/sebastian-sommerfeld-io/configs/src/main/homelab/services-cli.sh
.
Docker Compose Stack: monitoring.fritz.box
All clients (including all RasPi nodes) report their metrics to prometheus
. This allows for centralized collection of metrics from all clients, which can then be analyzed and visualized using a web-based UI provided by Grafana.
-
Prometheus is an open-source monitoring system that collects metrics from various sources and stores them in a time-series database.
-
Grafana is an open-source analytics and monitoring platform. It provides a web-based UI that allows users to visualize and analyze data from (in this case) Prometheus.
When you start the monitoring stack on your local machine, the same ports are used as in the production instance and when started will collect data from all configured sources, just as it does in the production instance. This allows you to test the monitoring stack locally and ensure that it is configured correctly before deploying it to production. Additionally, you can use the local monitoring stack to develop and test new dashboards and alerts before deploying them to the production environment.
Container Image | URL |
---|---|
|
http://monitoring.fritz.box (prod) Preferred way to access Grafana |
|
|
|
|
|
Connect via SSH and start the stack by using ~/work/repos/sebastian-sommerfeld-io/configs/src/main/homelab/services-cli.sh
.