Raspberry Pi's CPU and GPU temperature exporter for Prometheus consumption.

Overview

Pi Temp Exporter logo

Pi Temperature Exporter

A simple application for collecting Raspberry Pi's CPU and GPU temperatures and exporting them for Prometheus consumption.

Installation

The application can be run in two ways: running the binary file directly on the Raspberry Pi or in a Docker container.

Automated

Automated install/update of the application:

curl https://raw.githubusercontent.com/s-nagaev/pi-temperature-exporter/main/scripts/install.sh | bash

This script installs the binary to /usr/local/bin directory and sets up the systemd accordingly.

Manual

You can manually download a binary release from the release page.

Docker

To run this application as a Docker container, simply use the following command:

docker run --name pi-temp-exporter -p 9002:9002 pysergio/pi-temp-exporter

Note: when running as a Docker container, only the CPU temperature can be exported.

Alternatively, you can use the following Docker Compose file to set up the application:

version: '3'

services:
  pi-temp-exporter:
    image: pysergio/pi-temp-exporter
    ports:
      - "9002:9002"

Then you can start the application using the docker-compose up -d command.

Usage

Once the Pi Temperature Exporter is installed and running, you can verify that metrics are being exported by cURLing the /metrics endpoint:

curl http://localhost:9002/metrics

You should see output like this:

# HELP pi_cpu_temperature CPU Temperature in Celsius
# TYPE pi_cpu_temperature gauge
pi_cpu_temperature 57.939
# HELP pi_gpu_temperature GPU Temperature in Celsius
# TYPE pi_gpu_temperature gauge
pi_gpu_temperature 56.5

Success! The Pi Temperature Exporter is now exposing metrics that Prometheus can scrape!

Configure your Prometheus instance

If you need information about Prometheus installation steps, please, visit the official documentation page first.

The following prometheus.yml example configuration file will tell the Prometheus instance to scrape, and how frequently, from the Pi Temperature Exporter via your Raspberry Pi IP address. Suppose, your Raspberry Pi's local IP address is 192.168.0.100:

global:
  scrape_interval: 15s

scrape_configs:

- job_name: temperature
  static_configs:
  - targets: ['192.168.0.100:9002']

Health Check

The application also exposes a /health endpoint, which can be used for health check purposes.

License

This project is licensed under the MIT License - see the LICENSE.md file for details.

You might also like...
A library implementing GPU-accelerated zkSync prover.
A library implementing GPU-accelerated zkSync prover.

zkSync Era: A ZK Rollup For Scaling Ethereum zkSync Era is a layer 2 rollup that uses zero-knowledge proofs to scale Ethereum without compromising on

Blink program on RISC L106 80Mhz 32bit CPU

esp8266-blink Blink program on RISC L106 80Mhz 32bit CPU Flashing Running rust on ESP* is sort of hard... We won't cover the installation process, ins

A small script in rust to get the cpu usage in %'s with a gradient color for the text
A small script in rust to get the cpu usage in %'s with a gradient color for the text

cpu_usage-polybar A small script in rust to get the cpu usage in %'s with a gradient color for the text To get it to work on your PC you will have to

Determine which CPU architecture is used in a binary file.

cpu_rec_rs Determine which CPU architecture is used in a binary file. Example: $ cpu_rec_rs /bin/bash /usr/lib/firmware/rtlwifi/rtl8821aefw* Loading c

Reading Getting Friendly With CPU Caches
Reading Getting Friendly With CPU Caches

Getting Friendly With CPU Caches Reading Getting Friendly With CPU Caches, by Miki Tebeka and William Kennedy, inspired me to look at some Rust equiva

auto-epp-rs is a program that manages the energy performance preferences (EPP) of your AMD CPU using the AMD-Pstate driver.

auto-epp-rs is a program that manages the energy performance preferences (EPP) of your AMD CPU using the AMD-Pstate driver. It adjusts the EPP settings based on whether your system is running on AC power or battery power, helping optimize power consumption and performance. This project is a rewrite of the original Python version jothi-prasath/auto-epp in Rust, aiming to improve memory efficiency and overall performance.

Warp is a blazingly fast, Rust-based terminal that makes you and your team more productive at running, debugging, and deploying code and infrastructure.
Warp is a blazingly fast, Rust-based terminal that makes you and your team more productive at running, debugging, and deploying code and infrastructure.

Warp is a blazingly fast, Rust-based terminal that makes you and your team more productive at running, debugging, and deploying code and infrastructure.

This is a simple lnd poller and web front-end to see and read boosts and boostagrams.

Helipad This package will poll a Lightning LND node for invoices related to Podcasting 2.0 and display them in a web interface. It's intended for use

Comments
  • Installation script added, README updated.

    Installation script added, README updated.

    Added

    • Installation script.
    • Current changelog.md file.

    Changed

    • Exporting metrics renamed: prefix pi_ added.
    • README.md updated, installation process described.
    enhancement 
    opened by s-nagaev 0
Releases(0.2.0)
Sample and plot power consumption, average frequency and cpu die temperatures over time.

sense Sense is a small tool to gather data on cpu temperature, power usage and clock frequency and plot graphs during some load. Dependencies Sense is

Luuk van der Duim 6 Oct 31, 2022
A tool to control the fan speed by monitoring the temperature of CPU via IPMI.

ipmi-fan-control A tool to control the fan speed by monitoring the temperature of CPU via IPMI. Why Our Dell R730 server's iDRAC is not works as expec

yinheli 9 Dec 29, 2022
Zenith - sort of like top or htop but with zoom-able charts, CPU, GPU, network, and disk usage

Zenith - sort of like top or htop but with zoom-able charts, CPU, GPU, network, and disk usage

Benjamin Vaisvil 1.6k Jan 4, 2023
Cli tool for git productivity written in Rust and packaged for consumption via NPM

crust ?? cli tool for git productivity written in Rust and packaged for consumption via NPM This repo is identical with @skyneticist/golee in terms of

null 2 Jul 30, 2022
A simple program that provides DBus interface to control display temperature and brightness under wayland without flickering

wl-gammarelay-rs Like wl-gammarelay, but written in rust, runs on a single thread, has three times less SLOC and uses DBus (for simplicity). Dbus inte

Max Verevkin 33 Nov 23, 2022
A controller for the display and fan of the Raspberry Pi Waveshare PoE HAT written in Rust 🦀

???? RustBerry-PoE-Monitor RustBerry-PoE-Monitor is a Rust-based monitoring and control tool for the Raspberry Pi, specifically designed for use with

jack 5 Nov 27, 2023
A Raspberry Pi Pico-based sequencer for Eurorack

A Raspberry Pi Pico-based sequencer for Eurorack.

Pedro Ferreira 5 Oct 20, 2022
A CLI tool which can help you automatically kill process of your choice. Useful for freeing up memory and CPU usage!

Quickiller There are always programs such as chrome that keep eating up your resources even when closed! The only way to prevent this is to kill all o

Codingsquirrel 1 Dec 8, 2021
App to collect ram/cpu usage from OS and show it in pretty graphs

System info collector This is simple app to collect data about system cpu and memory usage over time. After collecting results into csv file, html fil

Rafał Mikrut 3 Jul 11, 2023
Introducing Inlyne, a GPU powered yet browsless tool to help you quickly view markdown files in the blink of an eye.

Inlyne - a GPU powered, browserless, markdown + html viewer inlyne README.md --theme dark/light About Markdown files are a wonderful tool to get forma

null 308 Jan 1, 2023