Part 4: Monitoring Raspberry Pi 4 performance in real time

Build a Chronograf dashboard of top of InfluxDB and Telegraf using Docker Compose

Image for post
Image for post
Photo by Luke Chesser on Unsplash

The TICK Stack

The so called TICK stack seems quite a extrange name, but it’s really a mnemotechnic designation that- just by mentioning the acronym of each letter- will make you retrieve the 4 components and explain to others what it is. Then let’s introduce the TICK stack with a brief sentence of each component:

  • -I-nfluxDB is the time series database
  • -C-hronograph is the visualization dashboard
  • -K-apacitor is the rules based system to configure alerts

Deployment using Docker Compose

Since this is the first stop in the journey about the TICK stack, let’s make it as easy as possibler and skip the Kapacitor component, deploying the minimum stack, i.e. TIC, composed of InfluxDB, Telegraf and Chronograf. You can find the code to deploy this simplified stack in Github.

$ git clone https://github.com/therobotacademy/InfluxBD-Telegraf-Chronograph.git TIC
  • ARMv7 for single board computers likeRaspberry Pi (RPi) versions 2 & 3, and
  • Arm64 running 64 bits OS in any of RPi3 or RPi4.

Deploying the TIC stack

Just change to the folder where you cloned the repository, type in the following command, and let the magic happens:

$ cd TIC
$ docker-compose up -d
  • Telegraf acquiring system metrics and writing data to InfluxDB in a database also called telegraf.
  • Chronograph visualization dashboard available at http://RPi4_IP:8888
Image for post
Image for post
Default apps in the host from where you are runnig Chonograf
$ docker exec -it telegraf cat /etc/telegraf/telegraf.conf
################################################################
# INPUTS #
################################################################
# Read metrics about docker containers
[[inputs.docker]]
# Docker Endpoint
endpoint = "unix:///var/run/docker.sock"
# Read metrics about system load & uptime
[[inputs.system]]
# no configuration
Image for post
Image for post
Chronograf host default dashboard
  • RAM memory
  • Swap memory

Monitoring system resources usage

In this section we are going to cover the steps to import the dashboard stored in the path ./dashboards/CPU-MEM-SWAP_SystemMetrics.json of the cloned of the repository.

Image for post
Image for post
Chronograf dasboards’ screen
Image for post
Image for post
Image for post
Image for post
Image for post
Image for post
Image for post
Image for post
Image for post
Image for post

Conclusion

If you have got stuck at any point of the deployment feel free to post your problem in the comment section below, and I will help you.

Image for post
Image for post
Raspberry Pi 400 setup inside the Pi keyboard

Software Engineer spreading cutting edge technologies. Psychologist applying the current knowledge of the human brain to power intelligent robots & IoT devices

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store