If you find this repository useful, please consider giving it a star. Your support is greatly appreciated! :pray:
Introducing the Raspberry Pi monitoring solution using Grafana, Prometheus, Cadvisor, and Node-Exporter Stack! This project aims to provide a comprehensive and user-friendly way to monitor the performance of your Raspberry Pi. With Grafana's intuitive dashboards, you can easily visualize system metrics collected by Prometheus and Cadvisor, while Node-Exporter provides valuable information about the Raspberry Pi's hardware and operating system. The combination of these tools results in a powerful and efficient monitoring solution that will give you complete visibility into your system's health. Check out the project and take your Raspberry Pi monitoring to the next level !
This repository contains a docker-compose
file to run a Raspberry PI monitoring stack. It is based on the following projects:
Before we get started installing the stack, we need to make sure that the following prerequisites are met:
To install the stack, follow the steps below:
Clone this repository to your host machine.
git clone https://github.com/oijkn/Docker-Raspberry-PI-Monitoring.git
Enter to the cloned directory.
cd Docker-Raspberry-PI-Monitoring
[] make scripts for create directory
data
directory and change the ownership of the prometheus
and grafana
folders for a nice and clean installation.
mkdir -p prometheus/data grafana/data && \
mkdir -p app/backend/data && \
mkdir -p redis/data && \
mkdir -p caddy/data && \
mkdir -p postgres/data && \
sudo chown -R 472:472 grafana/ && \
sudo chown -R 65534:65534 prometheus/
# Grafana Proxy Configuration
grafana.domain.name {
header /* {
Strict-Transport-Security "max-age=31536000; includeSubDomains; preload"
X-Content-Type-Options "nosniff"
X-Frame-Options "DENY"
Referrer-Policy "no-referrer-when-downgrade"
}
reverse_proxy grafana:3000
}
grafana.domain.name { reverse_proxy chatgpt:8080 }
- Start the stack with `docker-compose`.
```bash
docker-compose up -d
This will start all the containers and make them available on the host machine.
The following ports are used (only Grafana is exposed on the host machine):
In order to check if the stack is running correctly, you can run the following command:
docker-compose ps
View the logs of a specific container by running the following command:
docker logs -f <container-name>
Since Grafana v5 has introduced the concept of provisioning, it is possible to automatically add data sources and dashboards to Grafana.
This is done by placing the datasources
and dashboards
directories in the provisioning folder. The files in these directories are automatically loaded by Grafana on startup.
If you like to add a new dashboard, simply place the JSON file in the dashboards directory, and it will be automatically loaded next time Grafana is started.
If you would like to install this dashboard from Grafana.com, simply follow the steps below:
Copy ID to Clipboard
buttonImport
page in GrafanaImport via grafana.com
fieldLoad
buttonImport
buttonOr you can follow the steps described in the Grafana Documentation.
This dashboard is intended to help you get started with monitoring your Raspberry PI devices. If you have any changes or suggestions, you would like to see, please feel free to open an issue or create a pull request.
Here is a screenshot of the dashboard:
This project is licensed under the MIT License - see the LICENSE file for details
Enable c-group
memory and swap accounting on the host machine by running the following command:
sudo sed -i 's/^GRUB_CMDLINE_LINUX=""/GRUB_CMDLINE_LINUX="cgroup_enable=cpuset cgroup_enable=memory cgroup_memory=1 swapaccount=1"/' /etc/default/grub
sudo update-grub
sudo reboot