pihole

package
v0.0.0-...-6ade924 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 8, 2022 License: GPL-3.0 Imports: 9 Imported by: 0

README

Pi-hole monitoring with Netdata

Pi-hole is a Linux network-level advertisement and Internet tracker blocking application which acts as a DNS sinkhole, intended for use on a private network.

This module will monitor one or more Pi-hole instances using PHP API.

The API exposed data time frame is for the last 24 hr. All collected values are for that time frame, not for the module collection interval.

Metrics

All metrics have "pihole." prefix.

Metric Scope Dimensions Units
dns_queries_total global queries queries
dns_queries global cached, blocked, forwarded queries
dns_queries_percentage global cached, blocked, forwarded percentage
unique_clients global unique clients
domains_on_blocklist global blocklist domains
blocklist_last_update global ago seconds
blocklist_file_existence_state global exists, not_exists state
unwanted_domains_blocking_status global enabled, disables status
dns_queries_types global a, aaaa, any, ptr, soa, srv, txt percentage
dns_queries_forwarded_destination global cache, blocklist percentage
top_clients global a dimension per client requests
top_permitted_domains global a dimension per domain hits
top_blocked_domains global a dimension per domain hits

Configuration

Edit the go.d/pihole.conf configuration file using edit-config from the Netdata config directory, which is typically at /etc/netdata.

cd /etc/netdata # Replace this path with your Netdata config directory
sudo ./edit-config go.d/pihole.conf

Module automatically detects Pihole web password reading setupVars.conf file. It expects to find the file in the /etc/pihole/ directory.

If you want to monitor remote instance you need to set the password in the module configuration file.

Here is an example for local and remote instances:

jobs:
  - name: local
    top_clients_entries: 10
    top_items_entries: 10  # top permitted and top blocked domains charts

  - name: remote
    url: http://203.0.113.10
    password: 1ebd33f882f9aa5fac26a7cb74704742f91100228eb322e41b7bd6e6aeb8f74b

  - name: remote_https
    url: https://203.0.113.11
    password: 1ebd33f882f9aa5fac26a7cb74704742f91100228eb322e41b7bd6e6aeb8f74b
    tls_skip_verify: yes  # self signed certificate verification skip

For all available options please see module configuration file.

Troubleshooting

To troubleshoot issues with the pihole collector, run the go.d.plugin with the debug option enabled. The output should give you clues as to why the collector isn't working.

First, navigate to your plugins' directory, usually at /usr/libexec/netdata/plugins.d/. If that's not the case on your system, open netdata.conf and look for the setting plugins directory. Once you're in the plugin's directory, switch to the netdata user.

cd /usr/libexec/netdata/plugins.d/
sudo -u netdata -s

You can now run the go.d.plugin to debug the collector:

./go.d.plugin -d -m pihole

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Chart

type Chart = module.Chart

Chart is an alias for module.Chart

type Charts

type Charts = module.Charts

Charts is an alias for module.Charts

type Config

type Config struct {
	web.HTTP          `yaml:",inline"`
	SetupVarsPath     string `yaml:"setup_vars_path"`
	TopClientsEntries int    `yaml:"top_clients_entries"`
	TopItemsEntries   int    `yaml:"top_items_entries"`
}

Config is the Pihole module configuration.

type Dim

type Dim = module.Dim

Dim is an alias for module.Dim

type Dims

type Dims = module.Dims

Dims is an alias for module.Dims

type Pihole

type Pihole struct {
	module.Base
	Config `yaml:",inline"`
	// contains filtered or unexported fields
}

Pihole Pihole module.

func New

func New() *Pihole

New creates Pihole with default values.

func (Pihole) Charts

func (p Pihole) Charts() *module.Charts

Charts returns Charts.

func (Pihole) Check

func (p Pihole) Check() bool

Check makes check.

func (Pihole) Cleanup

func (Pihole) Cleanup()

Cleanup makes cleanup.

func (*Pihole) Collect

func (p *Pihole) Collect() map[string]int64

Collect collects metrics.

func (*Pihole) Init

func (p *Pihole) Init() bool

Init makes initialization.

type Vars

type Vars = module.Vars

Vars is an alias for module.Dim

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL