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
curl
for requesting the apijq
to parse, extract and build the JSON for telegrafsed
to perform transfromations on datatypes to make them compatible with influxdb
- Copy the file
piholestats.sh
to/usr/local/bin
. Make sure it has execution permission (may requirechmod +x
). - Edit the file
/etc/telegraf/telegraf.conf
and paste the content below: - (optional) import the example
grafana.json
dashboard
# PiHole monitoring
[[inputs.exec]]
commands = ["/usr/local/bin/piholestats.sh"]
timeout = "10s"
data_format = "json"
name_suffix = "_pihole"
Measurement name is exec_pihole
.