Skip to content

Latest commit

 

History

History
52 lines (29 loc) · 2.32 KB

README.md

File metadata and controls

52 lines (29 loc) · 2.32 KB

Pi Metrics 🥧📊

Simple system metrics collection and monitoring using InfuxDB, Telegraf, and Grafana running in Docker using Docker Compose.

GitHub Logo

Requirements

  • Docker
  • Docker Compose

Quickstart

Start the Containers

docker-compose up -d

This will create a network called pi-metrics_default and start 3 containers running on that network.

Run docker ps to check the container statuses.

Run docker-compose logs to check container logs.

Grafana Setup

Grafana might need permission to write to the mounted directory for it's data. Run sudo chown -R 472:472 /tmp/grafana/ where /tmp/grafana is the default directory where data is stored on the host machine.

Once the container processes have started, you can access the Grafana dashboard at http://localhost:3000 .

Default Grafana credentials are admin/admin.

On first run, go to Configuration > Data Sources and add an InfluxDB datasource and edit the following details:

  • url: http://metricsdb:8086
  • database: telegraf

Save & Test the connection. Once successful, you can go to Dashboards > Manage and create a new Dashboard. Select your InfluxDB datasouce and pick some default system metrics being reported like disk or cpu to visualize.

Telegraf is also configured to ping the 8.8.8.8 DNS server as well as some common websites like Google and Amazon to poll and record network latencies.

Customizations

The telegraf.conf file can be edited to report on many more metrics. You can check the telegraf docs for more information or check the full example conf file.

Acknowledgements

This was created by roughly following a tutorial here with some enhancements.

The commands used in the original tutorial (which was written specifically to be run on a Raspberry Pi) can be found in the setup.sh script.