Christopher Nethercott dc11fb06e8 Update | пре 3 година | |
---|---|---|
.github | пре 3 година | |
.dockerignore | пре 3 година | |
.gitignore | пре 3 година | |
Dockerfile | пре 3 година | |
README.md | пре 3 година | |
main.py | пре 3 година | |
requirements.txt | пре 3 година |
Based slightly on my other project, speedtest-to-influxdb. This project leverages the Pi-Hole API to gather data about your PiHole instance and store it inside of InfluxDB for your future projects.
This project is automatically built through GitHub actions and the DockerHub file can be found here.
The InfluxDB connection settings can be configured as followed:
The PiHole settings can be configured as followed:
PIHOLE_INTERVAL=15 Interval in seconds
Certain parts of the API require you to be authenticated, this can be achieved by supplying the PIHOLE_AUTHENTICATION
token with the password you use to login to the web interface.
By doing this you'll gain access to two new measurements (tables):
authenticated_query_types
authenticated_forward_destinations
This does mean that your password is stored in plaintext as an envronmental variable and as such as malicious actor could find it and access your PiHole instance. You are advised to use this at your own risk.
docker run -d --name pihole-to-influx \
-e 'INFLUX_DB_ADDRESS'='_influxdb_host_' \
-e 'INFLUX_DB_PORT'='8086' \
-e 'INFLUX_DB_USER'='_influx_user_' \
-e 'INFLUX_DB_PASSWORD'='_influx_pass_' \
-e 'INFLUX_DB_DATABASE'='pihole' \
-e 'PIHOLE_INTERVAL'='1800' \
-e 'PIHOLE_HOSTNAME'='192.168.xxx.xxx' \
chriscn/pihole-to-influxdb
version: '3'
services:
pihole-to-influxdb:
image: chriscn/pihole-to-influxdb
container_name: pihole-to-influxdb
environment:
- INFLUX_DB_ADDRESS=192.168.xxx.xxx
- INFLUX_DB_PORT=8086
- INFLUX_DB_USER=user
- INFLUX_DB_PASSWORD=pass
- INFLUX_DB_DATABASE=pihole
- PIHOLE_HOSTNAME=192.168.xxx.xxx
- PIHOLE_INTERVAL=15