{"id":13582549,"url":"https://github.com/fgrosse/pi-temp","last_synced_at":"2026-01-17T11:03:19.323Z","repository":{"id":53380268,"uuid":"144500865","full_name":"fgrosse/pi-temp","owner":"fgrosse","description":"Small utility to export the CPU temperature of a Raspberry Pi as Prometheus metric.","archived":false,"fork":false,"pushed_at":"2018-08-12T22:02:12.000Z","size":244,"stargazers_count":21,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-22T22:41:14.566Z","etag":null,"topics":["prometheus","prometheus-exporter","raspberry-pi"],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fgrosse.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-08-12T21:07:23.000Z","updated_at":"2022-08-12T08:24:31.000Z","dependencies_parsed_at":"2022-08-26T13:00:45.276Z","dependency_job_id":null,"html_url":"https://github.com/fgrosse/pi-temp","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fgrosse%2Fpi-temp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fgrosse%2Fpi-temp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fgrosse%2Fpi-temp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fgrosse%2Fpi-temp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fgrosse","download_url":"https://codeload.github.com/fgrosse/pi-temp/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247495783,"owners_count":20948107,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["prometheus","prometheus-exporter","raspberry-pi"],"created_at":"2024-08-01T15:02:49.660Z","updated_at":"2026-01-17T11:03:19.284Z","avatar_url":"https://github.com/fgrosse.png","language":"Go","funding_links":[],"categories":["Go"],"sub_categories":[],"readme":"# pi-temp\n\n[![Build Status](https://secure.travis-ci.org/fgrosse/pi-temp.png?branch=master)](http://travis-ci.org/fgrosse/pi-temp)\n[![License](https://img.shields.io/badge/license-MIT-4183c4.svg)](https://github.com/fgrosse/pi-temp/blob/master/LICENSE)\n\nSmall utility to export the CPU temperature of a Raspberry Pi as Prometheus metric.\n\n### Usage\n\n```shell\n# Cross compile and upload to your raspberry:\n$ GOARCH=arm64 go build \u0026\u0026 scp pi-temp raspberry:/usr/local/bin/pi-temp\npi-temp                                                    100% 9619KB   9.4MB/s   00:01\n\n# Log into your Pi:\n$ ssh raspberry\n\n# Helpful help output is helpful:\nUsage of pi-temp:\n  -addr string\n    \tThe address to listen on for HTTP requests. (default \":8080\")\n  -debug\n    \tEnable debug output.\n  -file string\n    \tPath to the thermal zone file. (default \"/sys/class/thermal/thermal_zone0/temp\")\n  -interval duration\n    \tThe interval at which the temperature is checked. (default 10s)\n\n# Run it:\n$ pi-temp -debug\nChecking temperature every 10s from \"/sys/class/thermal/thermal_zone0/temp\"\nCPU temperature: 55.306°C\nCPU temperature: 54.768°C\nCPU temperature: 54.768°C\nCPU temperature: 54.768°C\n…\n```\n\n### Why?\n\nNode exporter apparently doesn't track this metric and this was super easy to do by myself.\n\n### Systemd\n\nI use the [`pi-temp.service`](pi-temp.service) file to install the cross compiled\nbinary as simple systemd service into my Raspberry Pi like this:\n\n```shell\n# Upload systemd unit file:\n$ scp pi-temp.service raspberry:/etc/systemd/system/pi-temp.service\n\n# Log into your Pi:\n$ ssh raspberry\n\n# Enable service to start on boot:\n$ systemctl enable pi-temp.service\n\n# Start pi-temp service now:\n$ systemctl start pi-temp\n\n# Check its running:\n$ systemctl status pi-temp\n● pi-temp.service - Prometheus Temperature Monitor\n   Loaded: loaded (/etc/systemd/system/pi-temp.service; enabled; vendor preset: disabled)\n   Active: active (running) since Sun 2018-08-12 23:20:18 CEST; 1s ago\n Main PID: 7886 (pi-temp)\n    Tasks: 7 (limit: 1053)\n   Memory: 1.3M\n   CGroup: /system.slice/pi-temp.service\n           └─7886 /usr/local/bin/pi-temp -interval=10s -addr=:9101\n\nAug 12 23:24:49 rasputin systemd[1]: Started Prometheus Temperature Monitor.\nAug 12 23:24:49 rasputin pi-temp[7953]: Starting pi-temp web server at \":9101\"\nAug 12 23:24:49 rasputin pi-temp[7953]: If you want to see more verbose log run with -debug\n```\n\n### License\n\n© Friedrich Große 2018, distributed under [MIT License](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffgrosse%2Fpi-temp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffgrosse%2Fpi-temp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffgrosse%2Fpi-temp/lists"}