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...
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

Sets of libraries and tools to write applications and libraries mixing OCaml and Rust

Sets of libraries and tools to write applications and libraries mixing OCaml and Rust. These libraries will help keeping your types and data structures synchronized, and enable seamless exchange between OCaml and Rust

Downloads and provides debug symbols and source code for nix derivations to gdb and other debuginfod-capable debuggers as needed.

nixseparatedebuginfod Downloads and provides debug symbols and source code for nix derivations to gdb and other debuginfod-capable debuggers as needed

Tooling and library for generation, validation and verification of supply chain metadata documents and frameworks

Spector Spector is both tooling and a library for the generation, validation and verification of supply chain metadata documents and frameworks. Many

Execution of and interaction with external processes and pipelines

subprocess The subprocess library provides facilities for execution of and interaction with external processes and pipelines, inspired by Python's sub

 create and test the style and formatting of text in your terminal applications
create and test the style and formatting of text in your terminal applications

description: create and test the style and formatting of text in your terminal applications docs: https://docs.rs/termstyle termstyle is a library tha

Command-Line program that takes images and produces the copy of the image with a thin frame and palette made of the 10 most frequent colors.
Command-Line program that takes images and produces the copy of the image with a thin frame and palette made of the 10 most frequent colors.

paleatra v.0.0.1 Command-Line program that takes an image and produces the copy of the image with a thin frame and palette made of the 10 most frequen

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 Raspberry Pi Pico-based sequencer for Eurorack

A Raspberry Pi Pico-based sequencer for Eurorack.

Pedro Ferreira 5 Oct 20, 2022
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
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
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

Spar 2 Oct 25, 2021
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

Sara 4 Apr 18, 2023