|
| 1 | +Raspberry metrics |
| 2 | +================= |
| 3 | + |
| 4 | +Expose raspberry PI metrics using [Grafana](https://grafana.com/) and [Prometheus](https://prometheus.io/): |
| 5 | + |
| 6 | + |
| 7 | + |
| 8 | +## About ## |
| 9 | + |
| 10 | +This project contains [Ansible](https://www.ansible.com/) playbook which installs three services on Raspberry: |
| 11 | + |
| 12 | +* [Node exporter](https://github.com/prometheus/node_exporter) - expose Raspberry metrics (v0.14.0) |
| 13 | +* [Prometheus](https://prometheus.io/) - collect and store metrics (v1.7.1) |
| 14 | +* [Grafana](https://grafana.com/) - metrics visualization (v4.3.2) |
| 15 | + |
| 16 | + |
| 17 | + |
| 18 | +### Prerequisites ### |
| 19 | + |
| 20 | +* Raspberry PI with ARMv7 processor (Tested on [Raspberry PI 2 Model B](https://www.raspberrypi.org/products/raspberry-pi-2-model-b/)) |
| 21 | +* Debian installed on Raspberry (like [Raspbian Jessie](https://www.raspberrypi.org/downloads/raspbian/)) |
| 22 | +* open port 22 on raspberry (SSH) |
| 23 | +* open port 3000 on raspberry (Grafana) |
| 24 | + |
| 25 | +## How to install ## |
| 26 | + |
| 27 | +[Ansible](https://www.ansible.com/) is required for installation. |
| 28 | + |
| 29 | +If you don't have Ansible installed, see [Ansible installation](http://docs.ansible.com/ansible/intro_installation.html). |
| 30 | + |
| 31 | +### 1. Configure Raspberry IP address ### |
| 32 | + |
| 33 | +Checkout project. |
| 34 | + |
| 35 | +Edit file **ansible/hosts** and set Raspberry IP address. |
| 36 | + |
| 37 | +### 2. Run ansible playbook ### |
| 38 | + |
| 39 | +Run Ansible playbook with password authentication: |
| 40 | +``` |
| 41 | + cd ansible/ |
| 42 | + ansible-playbook raspberry.yml -i hosts -u pi -k -K |
| 43 | +``` |
| 44 | + |
| 45 | +Run Ansible playbook with SSH keys authentication: |
| 46 | + |
| 47 | +``` |
| 48 | + cd ansible/ |
| 49 | + ansible-playbook raspberry.yml -i hosts -u pi |
| 50 | +``` |
| 51 | + |
| 52 | +### 3. Configure Grafana datasource ### |
| 53 | + |
| 54 | +* Go to Grafana URL http://raspberry:3000/ |
| 55 | +* login with admin/admin |
| 56 | +* add new Data Source: |
| 57 | + |
| 58 | + |
| 59 | + |
| 60 | +* Click on "Raspberry metrics" dashboard: |
| 61 | + |
| 62 | + |
| 63 | + |
| 64 | +That's it. |
0 commit comments