prometheus...n-exporter(1)

πŸ“¦ version 1.1, in ubuntu stonking

✨ NAME ✨

prometheus-diskspin-exporter β€” bestie, it's literally here to monitor your spinning rust disks in Prometheus πŸ’–


πŸ¦‹ SYNOPSIS πŸ¦‹

prometheus-diskspin-exporter INTERFACE PORT

🌸 DESCRIPTION 🌸

okay so. prometheus-diskspin-exporter is a zero-dependency Python program that will export the power state of the SATA disks found on the host and expose them to an HTTP endpoint for consumption by Prometheus. no cap. 🫢

Here's the vibe: it monitors if the disks are correctly shut down according to scheduled time in the disk, or manual calls to hdparm -y. It calls hdparm -C on every request and parses the status of each SATA disk /dev/sd* reported by lsblk. ✨

Now the important part β€” the program limits queries on SATA disks because NVME SSDs and other disk types will often respond with an unknown status to the hdparm -C command. so yeah, it's not being lazy, it's being selective πŸ’…

This way one can monitor disk spin status to be sure that the spin policy works correctly: energy is saved and noise is reduced when not in use, and disks do not spin up and down too often to prevent wear. iconic behavior honestly. πŸ”₯


πŸ’… OPTIONS πŸ’…

  • INTERFACE β€” Network interface to bind to. An empty string binds on all interfaces. (yes, all of them, she's everywhere 🌈)
  • PORT β€” Network port to listen on. πŸŽ€

πŸŽ€ EXAMPLES πŸŽ€

Below is an example output of an HTTP response sent from the server, and she ate:

hdparm_disk_power_status{disk="/dev/sda",status="standby"} 1 1731616722000
hdparm_disk_power_status{disk="/dev/sdb",status="standby"} 1 1731616722000
hdparm_disk_power_status{disk="/dev/sdc",status="standby"} 1 1731616722000
hdparm_disk_power_status{disk="/dev/sdd",status="active/idle"} 1 1731616722000

πŸ’€ BUGS πŸ’€

ngl, there's some stuff you need to know about. not me being the bearer of bad news but here we are πŸ™ˆ

The server will reply for any URL, not only /metrics. Why? Because this is the only thing the server do and there is no point in parsing the query url to match it. it's giving "i have one job and i do it" 😭

The server will run lsblk and hdparm -C on every request. This may DDoS your machine if an attacker spams the server. Always make sure to allow access to this HTTP server only for authorized users.

🚨 bestie PLEASE. do not leave this thing wide open on the internet. she's small and she's trying her best but she cannot fight an attacker for you. lock it down. periodt.

See https://github.com/gagath/prometheus-diskspin-exporter/issues to file your complaints (politely, she's sensitive πŸ₯Ί)


🌈 SEE ALSO 🌈

  • hdparm(1)
  • lsblk(1)

and that's the whole page, bestie!! πŸ¦‹βœ¨ this was prometheus...n-exporter(1) from the General Commands Manual, and this version is dated 2026-01-24. go monitor those disks and stay iconic πŸ‘‘πŸ’–

πŸ“¦ where this page comes from