{"id":16678231,"url":"https://github.com/mindflavor/prometheus_smartctl_temperature_exporter","last_synced_at":"2025-04-09T21:32:55.001Z","repository":{"id":47947829,"uuid":"394719071","full_name":"MindFlavor/prometheus_smartctl_temperature_exporter","owner":"MindFlavor","description":"An exporter for the disk temperature reported by smartctl, written in Rust","archived":false,"fork":false,"pushed_at":"2024-11-02T16:47:02.000Z","size":140,"stargazers_count":5,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-08T17:08:44.087Z","etag":null,"topics":["disk","prometheus","prometheus-exporter","smartctl","temperature","temperature-monitoring"],"latest_commit_sha":null,"homepage":"","language":"Rust","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/MindFlavor.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-08-10T16:55:45.000Z","updated_at":"2024-11-02T16:47:06.000Z","dependencies_parsed_at":"2025-02-15T22:31:43.237Z","dependency_job_id":"55743536-5220-4f6e-8349-7679d49998ce","html_url":"https://github.com/MindFlavor/prometheus_smartctl_temperature_exporter","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MindFlavor%2Fprometheus_smartctl_temperature_exporter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MindFlavor%2Fprometheus_smartctl_temperature_exporter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MindFlavor%2Fprometheus_smartctl_temperature_exporter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MindFlavor%2Fprometheus_smartctl_temperature_exporter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MindFlavor","download_url":"https://codeload.github.com/MindFlavor/prometheus_smartctl_temperature_exporter/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248114924,"owners_count":21050142,"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":["disk","prometheus","prometheus-exporter","smartctl","temperature","temperature-monitoring"],"created_at":"2024-10-12T13:28:49.762Z","updated_at":"2025-04-09T21:32:54.967Z","avatar_url":"https://github.com/MindFlavor.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Prometheus smartctl temperature exporter\n\nAn exporter for the disk temperature reported by `smartctl`, written in Rust.\n\n![](extras/00.png)\n\n[![legal](https://img.shields.io/github/license/mindflavor/prometheus_smartctl_temperature_exporter.svg)](LICENSE) ![stability-stable](https://img.shields.io/badge/stability-stable-green.svg)\n\n[![Crate](https://img.shields.io/crates/v/prometheus_smartctl_temperature_exporter.svg)](https://crates.io/crates/prometheus_smartctl_temperature_exporter) [![cratedown](https://img.shields.io/crates/d/prometheus_smartctl_temperature_exporter.svg)](https://crates.io/crates/prometheus_smartctl_temperature_exporter) [![cratelastdown](https://img.shields.io/crates/dv/prometheus_smartctl_temperature_exporter.svg)](https://crates.io/crates/prometheus_smartctl_temperature_exporter)\n\n[![release](https://img.shields.io/github/release/MindFlavor/prometheus_smartctl_temperature_exporter.svg)](https://github.com/MindFlavor/prometheus_smartctl_temperature_exporter/tree/1.1.0)\n[![tag](https://img.shields.io/github/tag/mindflavor/prometheus_smartctl_temperature_exporter.svg)](https://github.com/MindFlavor/prometheus_smartctl_temperature_exporter/tree/1.1.0)\n\n[![Rust build](https://github.com/mindflavor/prometheus_smartctl_temperature_exporter/workflows/Lints/badge.svg)](https://github.com/mindflavor/prometheus_smartctl_temperature_exporter/actions?query=workflow%3ALints+branch%3Amain++)\n[![commitssince](https://img.shields.io/github/commits-since/mindflavor/prometheus_smartctl_temperature_exporter/1.1.0.svg)](https://img.shields.io/github/commits-since/mindflavor/prometheus_smartctl_temperature_exporter/1.1.0.svg)\n\n![Docker build](https://github.com/MindFlavor/prometheus_smartctl_temperature_exporter/workflows/CI/badge.svg)\n\n[![dockeri.co](https://dockeri.co/image/mindflavor/prometheus-smartctl-temperature-exporter)](https://hub.docker.com/r/mindflavor/prometheus-smartctl-temperature-exporter)\n\n## What is this?\n\nThis tool, upon Prometheus's request - enumerates your disks via `lsblk` command and for each block device of type disk will issue `smartctl -a -j`. It then proceeds to extract the temperature and present it in a valid Prometheus format, like this:\n\n```\n# HELP smartctl_device_temperature device temperature as reported by smartctl\n# TYPE smartctl_device_temperature gauge\nsmartctl_device_temperature{device=\"Samsung_SSD_840_EVO_250GB_S1DBNSBF380127V\"} 39\nsmartctl_device_temperature{device=\"Samsung_SSD_870_QVO_2TB_S5SUNF0R111858P\"} 37\nsmartctl_device_temperature{device=\"Samsung_SSD_870_QVO_2TB_S5SUNF0R111863B\"} 38\nsmartctl_device_temperature{device=\"OCZ-VERTEX3_OCZ-90RJ51213OH12OYW\"} 30\nsmartctl_device_temperature{device=\"CT120BX500SSD1_1915E17BC591\"} 48\nsmartctl_device_temperature{device=\"Samsung_SSD_870_QVO_2TB_S5SUNF0R111124X\"} 38\n```\n\n## Why\n\nI needed to resilver my ZFS array and I was concerned by overheating my disks because of the sustained operation. Unfortunately, while `smartctl` exposes the disk temperature, I was not able to import it in Prometheus in a straightforward manner, so I ended up writing a specialized Rust process that does just that. It's probably an overkill but being Rust it is super cheap to run.\n\n## Requirements\n\nYou need to have both `lsblk` and `smartctl` executables available in the `$PATH`. Also, since `smartctl` requires root privileges, you need to run the tool as root (or use the *prepend sudo* option).\nAh, you also need Rust to compile the tool. You can use the docker image, courtesy of [Quentin McGaw](https://github.com/qdm12) as it does everything for you.\n\n## Options\n\nOption | Mandatory | Accepted values | Default | Multiple | Description\n-- | -- | -- | -- | -- | --\n`-a` | No | - | No | No | Prepends `sudo` to the `smartctl` commands. Useful to avoid running the exporter as root.\n`-v` | No | - | No | No | Enable verbose logging. Useful for troubleshooting.\n`-l` | No | Any valid IP | `0.0.0.0` | No | IP address to listen from. Default listens on every device.\n`-p` | No | Any valid TCP port | 9587 | No | TCP port opened by the tool. Must be free.\n`-e` | No | Any valid regex | - | Yes | Regular expressions to exclude from the analysis. For example `z.*` excludes /dev/zXX disks (in my case these are ZFS virtual block devices). Useful to avoid warnings about not supported disks.\n\n## Hey, the tools says it does not support my hard disk! What should I do?\n\nThe output of `smartctl` depends heavily on the disk model. If your disk is not supported (as reported by the tool) all you have to do is to issue `sudo systemctl -a -j /dev/sdX` (where X is your disk) and open a issue with the resulting json. I will update the tool to support your disk as soon as possible.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmindflavor%2Fprometheus_smartctl_temperature_exporter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmindflavor%2Fprometheus_smartctl_temperature_exporter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmindflavor%2Fprometheus_smartctl_temperature_exporter/lists"}