# Install and setup instructions for the RPI Docker Monitor
## Introduction
A monitoring solution for Docker hosts and containers with [Prometheus](https://prometheus.io/), [Grafana](http://grafana.org/), [cAdvisor](https://github.com/google/cadvisor), [NodeExporter](https://github.com/prometheus/node_exporter).
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 `cmdline.txt`: This is stored in various locations depending on your OS. Some OS like PI OS Bullseye and Diet PI are setup to use cgroup ver 2 these change break several of the monitors so we need to disable that as well.
The numbers aren't really important what is important is that you see memory in the list if you don't confirm you have put it in the correct file. Don't go on until you get this working.
## Folder Setup Script
First thing we need to do is setup the folder structure and install some files that need to be in place for everything to work correctly.
You can change how long your data should be stored or leave the default **15d**. It can be set with {`ms`,`s`,`m`,`h`,`d`,`w`,`y`} or a combination of it (e.g. `2w3d` for 2 weeks and 3 days).
The default settings should all be good so **Deploy the Stack**
<br><br>
## Setup Grafana
Navigate to Grafana `http://<host-ip>:3000` and login with user ***admin*** password ***admin***. You can change the credentials in the template file or by supplying the `ADMIN_USER` and `ADMIN_PASSWORD` environment variables inside the container monitoring-prometheus.
```yaml
GF_SECURITY_ADMIN_USER=admin
GF_SECURITY_ADMIN_PASSWORD=changeme
GF_USERS_ALLOW_SIGN_UP=false
```
### Setup Prometheus as the default data source.
```
Grafana > Configuration > Data Sources > Prometheus
```
**It is important that you set the URL to http://monitoring-prometheus:9090/**<br><br>
Grafana is not preconfigured with dashboard, so you have to import it from the [json](https://github.com/oijkn/Docker-Raspberry-PI-Monitoring/blob/main/grafana/dashboard_by_oijkn.json) file.
Now we open the [json](https://github.com/oijkn/Docker-Raspberry-PI-Monitoring/blob/main/grafana/dashboard_by_oijkn.json) file and Click on the "raw" button to copy the content from the json file.
> Hint: Well the Dashboard is displayed you can select your profile > Preferences and change the default Dashboard to the new Dashboard you just create and it will always display the new Dashboad when you login.
## Pi Hosted : Raspberry Pi Docker Monitoring Part 7
[](https://www.youtube.com/watch?v=IoD3vFuep64)4
## Acknowledgment
* based on [Docker-Raspberry-PI-Monitoring](https://github.com/oijkn/Docker-Raspberry-PI-Monitoring) by Oijkn