Skip to content

gmmoreira/pihole-stats-telegraf

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Pi-hole stats for Telegraf

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.

grafana dashboard

Requirements

  • Pi-hole: It has only been tested in Pi-hole v4.0. It may require some adjustments in another versions
  • curl for requesting the api
  • jq to parse, extract and build the JSON for telegraf
  • sed to perform transfromations on datatypes to make them compatible with influxdb

Installation

  • Copy the file piholestats.sh to /usr/local/bin. Make sure it has execution permission (may require chmod +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.

About

Pi-hole stats for telegraf

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages