This is a simple exporter for the Prometheus metrics using smartctl. The script smartprom.py
also comes with smartprom.service
so that you can run this script in the background on your Linux OS via systemctl
. The script will use port 9902
, you can change it by changing it directly in the script. This does not export all of the S.M.A.R.T data, only the ones I have been able to harvest from a Seagate Barracuda hard drive.
Docker image here: https://hub.docker.com/r/matusnovak/prometheus-smartctl
- Copy the
smartprom.service
file into/etc/systemd/system
folder. - Copy the
smartprom.py
file anywhere into your system. - Modify
ExecStart=
in thesmartprom.service
so that it points tosmartprom.py
in your system. - Run
chmod +x smartprom.py
- Install
prometheus_client
for the root user, example:sudo -H python3 -m pip install prometheus_client
- Run
systemctl enable smartprom
andsystemctl start smartprom
- Your metrics will now be available at
http://localhost:9902
version: '3'
services:
smartctl-metrics:
image: matusnovak/prometheus-smartctl:latest
restart: unless-stopped
privileged: true
ports:
- 9902:9902
Your metrics will be available at http://localhost:9902/metrics