Leanpub Header

Skip to main content

Raspberry Pi Computing: Monitoring with Prometheus and Grafana

Measure, record, visualize and understand your systems

Raspberry Pi Computing: Monitoring with Prometheus and Grafana aims to provide a description of the process of setting up a Raspberry Pi computer to measure, record and present metrics using a combination of Prometheus and Grafana.

The author is letting you choose the price you pay for this book!

Pick Your Price...
PDF
EPUB
WEB
611
Readers
190
Pages
About

About

About the Book

If you've heard about the Raspberry Pi you may know that it provides a fantastic method to learn about using a computer and to develop some skills that go beyond the basics. 

It has the ability to provide a bridge between the sometimes abstract computing environment and the physical world. In this case we are going to use it to set up a monitoring 'stack' consisting of the software platforms Prometheus and Grafana. This will allow us to measure and monitor a range of different aspects of computing technology including developing your own specialised monitoring.

What sort of things will we learn?

Good question! 

  • What sort of versions of the Raspberry Pi are there?
  • What hardware do I need to get it up and going?
  • What sort of operating system do I need and how do we install it.
  • How do I do [Insert any number of cool things]?

Is this book for you?

It's not written for experts. It's put together as a guide to get you started if you're unsure about how to make the first move with a Raspberry Pi.

Why has the book been written?

Because in the process of learning things, it's a great way to remember them if you write them down :-).

Writing about how to do cool stuff with computers means that we're accumulating ways to help ourselves out when the going gets tricky. Making a book out of the information is a no-brainer since that way more people benefit from the process.

The awesome that is Leanpub.

The book has some information in it, but there will be updates over time. Publishing using Leanpub will allow readers to get easy notification of when updates and improvements are made.

Enjoy.

So we hope you get something out of the book, please excuse the sometimes light-hearted conversational manner in which we approach the topic and enjoy the Raspberry Pi!

Price

Pick Your Price...

Minimum price

Free!

$0.99

You pay

$0.00

Author earns

$0.00
$

All prices are in US $. You can pay in US $ or in your local currency when you check out.

EU customers: prices exclude VAT, which is added during checkout.

...Or Buy With Credits!

Number of credits (Minimum 0)

0
The author will earn $0.00 from your purchase!
You can get credits monthly with a Reader Membership

Author

About the Author

Malcolm Maclean

I have a passion for knowledge and I realise that part of the responsibility of gathering knowledge is being able to advance the state of the human condition in some way.

My aims in writing these books are to play with software, achieve personal goals and try something new for fun. It also helps that I think Open Source, technology, the visual representation of data and information rock in serious ways.

The books that I write are a mechanism to support my own learning, so the way I explain things is focused on trying to impart understanding in a simple but functional way.

I'm totally in awe of the Open Source community that has made this type of work possible. If you feel that you would like to support continued development of this content, feel free to donate when you download.

If you're looking for a hard copy version of any of these publications, they will be available through Amazon (not all will be available sorry).

Contents

Table of Contents

Introduction

  1. Welcome!
  2. What are we trying to do?
  3. Who is this book for?
  4. What will we need?
  5. Why on earth did I write this rambling tome?
  6. Where can you get more information?

The History of the Raspberry Pi

Raspberry Pi Versions

  1. Raspberry Pi B+, B2, B3 and B3+
  2. USB Ports
  3. Video Out
  4. Ethernet Network Connection
  5. USB Power Input Jack
  6. MicroSD Flash Memory Card Slot
  7. Stereo and Composite Video Output
  8. 40 Pin Header
  9. Raspberry Pi 4
  10. Pi 4 USB ports and Ethernet Ports
  11. Pi 4 USB C Power Input
  12. Pi 4 Dual Video Out

Raspberry Pi Peripherals

  1. SD Card
  2. Keyboard / Mouse
  3. Video
  4. Network
  5. Power supply
  6. Cases

Operating Systems

  1. Welcome to Raspberry Pi OS
  2. Raspberry Pi OS and Raspbian
  3. Operating System Evolution
  4. Downloading
  5. Writing the Operating System image to the SD Card
  6. Powering On
  7. The Command Line interface
  8. Raspberry Pi Software Configuration Tool
  9. Software Updates

Power Up the Pi

  1. Static IP Address
  2. The Netmask
  3. CIDR Notation
  4. Distinguish Dynamic from Static
  5. Default Gateway
  6. For OS’s Prior to bookworm
  7. For OS’s From bookworm onward
  8. Remote access
  9. Remote access via SSH
  10. Setting up the Server (Raspberry Pi)
  11. Setting up the Client (Windows)
  12. WinSCP
  13. Setting up a WiFi Network Connection
  14. Built in WiFi Enabling
  15. Make the changes operative
  16. Make the built in WiFi IP address static
  17. Make the changes operative
  18. WiFi Via USB Dongle
  19. Editing files
  20. Make the changes operative
  21. Make USB WiFi IP address static
  22. Make the changes operative

About Prometheus

About Grafana

Installation

  1. Installing Prometheus
  2. Installing Grafana
  3. Installing Grafana Manually
  4. Installing Grafana Automatically Using ‘apt-get’
  5. Using Grafana

Exporters

  1. Node Exporter

Prometheus Collector Configuration

  1. global
  2. alerting
  3. rule_files
  4. scrape_configs

Adding a monitoring node to Prometheus

  1. Let’s see our new node in Grafana!

WMI exporter

  1. Installing the WMI exporter
  2. Adding adding our Windows exporter to Prometheus
  3. Let’s see our new node in Grafana!

Custom Exporters

  1. Metrics
  2. Metric Types
  3. Metric Names
  4. Metric Labels
  5. Configuring the exporter
  6. Adding adding our custom exporter to Prometheus
  7. Creating a new graph in Grafana

Dashboards

  1. Overview
  2. New Panel
  3. Query Options
  4. Visualization Options
  5. Graph
  6. Stat
  7. Gauge
  8. Bar Gauge
  9. Table
  10. Singlestat
  11. Text
  12. Heatmap
  13. Dashboard List
  14. News Panel
  15. Logs
  16. General
  17. Alerting

Upgrading Prometheus

  1. Download
  2. Stop the services
  3. Copy the configuration and data
  4. Run the new version manually and test
  5. Stop the newer version
  6. Change the directory names
  7. Start the services.

Upgrading Grafana

  1. Download
  2. Stop the old version
  3. Copy the configuration and data
  4. Run the new version manually and test
  5. Stop the newer version
  6. Change the directory names
  7. Start the Grafana service.

Prometheus and Grafana Tips and Tricks

  1. Fill in Null Values in a Graph
  2. Exporting Data from a Grafana Graph

Linux Concepts

  1. What is Linux?
  2. Linux Directory Structure
  3. /
  4. /bin
  5. /boot
  6. /dev
  7. /etc
  8. /etc/cron.d
  9. /etc/rc?.d
  10. /home
  11. /lib
  12. /lost+found
  13. /media
  14. /mnt
  15. /opt
  16. /proc
  17. /root
  18. /sbin
  19. /srv
  20. /tmp
  21. /usr
  22. /usr/bin
  23. /usr/lib
  24. /usr/local
  25. /usr/sbin
  26. /var
  27. /var/lib
  28. /var/log
  29. /var/spool
  30. /var/tmp
  31. Everything is a file in Linux
  32. Traditional Files
  33. Directories
  34. System Information
  35. Devices

File Editing

  1. The nano Editor

Linux Commands

  1. Executing Commands in Linux
  2. The Commands
  3. Options
  4. Arguments
  5. Putting it all together
  6. apt-get
  7. The apt-get command
  8. apt-get update
  9. apt-get upgrade
  10. apt-get install
  11. apt-get remove
  12. cd
  13. The cd command
  14. Options
  15. Arguments
  16. Examples
  17. Test yourself
  18. ifconfig
  19. The ifconfig command
  20. Options
  21. Arguments
  22. Test yourself
  23. mv
  24. The mv command
  25. Options
  26. Examples
  27. Test yourself
  28. rm
  29. The rm command
  30. Options
  31. Arguments
  32. Test yourself
  33. sudo
  34. The sudo command
  35. The ‘sudoers’ file
  36. sudo vs su
  37. Test yourself
  38. tar
  39. The tar command
  40. Options
  41. Test yourself
  42. wget
  43. The wget command
  44. Test yourself

Directory Structure Cheat Sheet

The Leanpub 60 Day 100% Happiness Guarantee

Within 60 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.

Now, this is technically risky for us, since you'll have the book or course files either way. But we're so confident in our products and services, and in our authors and readers, that we're happy to offer a full money back guarantee for everything we sell.

You can only find out how good something is by trying it, and because of our 100% money back guarantee there's literally no risk to do so!

So, there's no reason not to click the Add to Cart button, is there?

See full terms...

Earn $8 on a $10 Purchase, and $16 on a $20 Purchase

We pay 80% royalties on purchases of $7.99 or more, and 80% royalties minus a 50 cent flat fee on purchases between $0.99 and $7.98. You earn $8 on a $10 sale, and $16 on a $20 sale. So, if we sell 5000 non-refunded copies of your book for $20, you'll earn $80,000.

(Yes, some authors have already earned much more than that on Leanpub.)

In fact, authors have earned over $14 million writing, publishing and selling on Leanpub.

Learn more about writing on Leanpub

Free Updates. DRM Free.

If you buy a Leanpub book, you get free updates for as long as the author updates the book! Many authors use Leanpub to publish their books in-progress, while they are writing them. All readers get free updates, regardless of when they bought the book or how much they paid (including free).

Most Leanpub books are available in PDF (for computers) and EPUB (for phones, tablets and Kindle). The formats that a book includes are shown at the top right corner of this page.

Finally, Leanpub books don't have any DRM copy-protection nonsense, so you can easily read them on any supported device.

Learn more about Leanpub's ebook formats and where to read them

Write and Publish on Leanpub

You can use Leanpub to easily write, publish and sell in-progress and completed ebooks and online courses!

Leanpub is a powerful platform for serious authors, combining a simple, elegant writing and publishing workflow with a store focused on selling in-progress ebooks.

Leanpub is a magical typewriter for authors: just write in plain text, and to publish your ebook, just click a button. (Or, if you are producing your ebook your own way, you can even upload your own PDF and/or EPUB files and then publish with one click!) It really is that easy.

Learn more about writing on Leanpub