Skip to content

Prometheus Smartctl

Repository

Tags: Monitoring

S.M.A.R.T. metrics exporter for Prometheus, using smartctl to report on HDD, SSD, and NVMe devices.

inventories/homelab/group_vars/homelab.yml
prometheus_smartctl_enabled: true

By default, Prometheus smartctl can be accessed at http://[your_server_ip]:9902 or https://prometheus_smartctl.[your_domain].com if you have DNS access configured.

See the default configuration options for Prometheus smartctl at roles/prometheus_smartctl/defaults/main.yml. Add any overrides to your inventories/[your_inventory]/group_vars/homelab.yml file.

Switched from matusnovak/prometheus-smartctl to prometheuscommunity/smartctl-exporter

Section titled “Switched from matusnovak/prometheus-smartctl to prometheuscommunity/smartctl-exporter”

The original matusnovak/prometheus-smartctl exporter has been archived and is no longer maintained (it also logged a recurring 'NoneType' object cannot be interpreted as an integer exception on every scrape). This role now uses the actively-maintained prometheus-community smartctl_exporter.

All exported metric names have changed from the smartprom_* prefix to smartctl_*. If you have custom Grafana panels, alerts, or recording rules referencing smartprom_* metrics, you must update them. The bundled monitoring overview dashboard has already been updated.

Common metric mappings:

Old (smartprom_*)New (smartctl_*)
smartprom_temperature_celsius_rawsmartctl_device_temperature{temperature_type="current"}
smartprom_power_on_hours_rawsmartctl_device_power_on_seconds (seconds — divide by 3600 for hours)
smartprom_power_cycle_count_rawsmartctl_device_power_cycle_count
smartprom_<attribute>_rawsmartctl_device_attribute{attribute_name="<Attribute>", attribute_value_type="raw"}

The per-disk label also changed from drive="/dev/sda" to device="sda".

No group_vars changes are required: the role still publishes metrics on host port 9902 (the new exporter listens on 9633 inside the container). It runs as root so smartctl can open the block devices.