pihole-exporter is a Go application that exports Pi-hole metrics.
The first step is downloading the correct release. In my case I run Pi-hole on a Debian VM so I downloaded the amd64 release. If you run Pi-hole on a Raspberry Pi you will need the arm release.
# amd64 ver. 0.0.8 wget https://github.com/eko/pihole-exporter/releases/download/0.0.8/pihole_exporter-linux-amd64 # arm ver. 0.0.8 wget https://github.com/eko/pihole-exporter/releases/download/0.0.8/pihole_exporter-linux-arm
Once you have the the executable downloaded lets create a space for it
Create a system user to run the exporter
useradd -r pihole_exporter
Move the executable to the folder we created
mv pihole_exporter-linux-amd64 /opt/pihole_exporter
Make sure to set the correct permissions
chgrp pihole_exporter /opt/pihole_exporter chgrp pihole_exporter /opt/pihole_exporter/pihole_exporter-linux-amd64 chmod +x /opt/pihole_exporter/pihole_exporter-linux-amd64 # NOTE: if you downloaded the arm release make sure you change the file name
Create a service file
nano /lib/systemd/system/pihole_exporter.service systemctl daemon-reload service pihole_exporter start systemctl enable pihole_exporter
The exporter should now be running on port 9617
All thats left is to setup the Prometheus job
- job_name: pihole static_configs: - targets: - 10.0.4.9:9617
The Github repo also provides a Grafana Dashboard.
Get $100 in cloud credits from DigitalOcean using my link: https://m.do.co/t/909d52b6253a