Setting up Pihole Exporter
Introduction to PiHole Exporter¶
PiHole Exporter is a monitoring tool designed to export PiHole metrics for use with Prometheus and Grafana. This guide covers deploying PiHole Exporter using Docker Compose, configuring required environment variables, and integrating it with Prometheus for effective monitoring and visualization.
Requirements¶
- PiHole v6 (latest version)
- Prometheus and Grafana installed and configured (Note: Prometheus could also be running via Docker)
Creating the Docker Compose File¶
Create a directory for your PiHole Exporter deployment and navigate into it:
Replace <user>
with your system username (e.g., techdox
).
Create a file named docker-compose.yml
with the following content:
services:
pihole-exporter:
image: ekofr/pihole-exporter:latest
ports:
- "9617:9617"
environment:
PIHOLE_HOSTNAME: "192.168.68.104" # IP address of your PiHole
PIHOLE_PASSWORD: "password" # PiHole web admin password
Configuration Details¶
PIHOLE_HOSTNAME
: IP address or hostname of your PiHole installation.PIHOLE_PASSWORD
: Password for your PiHole web interface.
Deploying PiHole Exporter¶
Navigate to your deployment directory and run Docker Compose:
This command pulls the PiHole Exporter image, creates, and starts the container.
Integrating with Prometheus¶
To visualize the exported metrics, add PiHole Exporter to your Prometheus scrape jobs by updating your Prometheus configuration:
Replace <exporter-host>
with your server’s IP address or hostname where PiHole Exporter is running.
After updating, restart Prometheus to apply changes:
orVisualizing Data with Grafana¶
In Grafana, you can import or create a dashboard to visualize PiHole metrics collected by Prometheus. Browse community dashboards or build your own for tailored monitoring.
Accessing PiHole Exporter¶
Ensure PiHole Exporter is running by accessing:
Replace localhost
with your server's IP or hostname if accessing remotely.
Conclusion¶
By following this guide, you've successfully deployed PiHole Exporter with Docker Compose, integrated it with Prometheus, and are ready to visualize metrics in Grafana.
If there is an issue with this guide or you wish to suggest changes, please raise an issue on GitHub.