This repository contains a small bash script that extract a few metrics from Pi-hole admin api. Combined with telegraf, those metrics can be outputed to a database like InfluxDB and visualized in graphing tools like Grafana.
- Pi-hole: It has only been tested in Pi-hole v4.0. It may require some adjustments in another versions
curlfor requesting the apijqto parse, extract and build the JSON for telegrafsedto perform transfromations on datatypes to make them compatible with influxdb
- Copy the file
piholestats.shto/usr/local/bin. Make sure it has execution permission (may requirechmod +x). - Edit the file
/etc/telegraf/telegraf.confand paste the content below: - (optional) import the example
grafana.jsondashboard
# PiHole monitoring
[[inputs.exec]]
commands = ["/usr/local/bin/piholestats.sh"]
timeout = "10s"
data_format = "json"
name_suffix = "_pihole"
Measurement name is exec_pihole.
