Compare commits

...

59 commits

Author SHA1 Message Date
Vincent Composieux
4c35b99235
Merge pull request #204 from eko/dependabot/go_modules/golang.org/x/net-0.16.0
Bump golang.org/x/net from 0.15.0 to 0.16.0
2023-10-08 22:58:15 +02:00
Vincent Composieux
00fa6de9f0
Merge pull request #205 from eko/dependabot/docker/golang-1.21.2-alpine3.17
Bump golang from 1.21.1-alpine3.17 to 1.21.2-alpine3.17
2023-10-08 22:58:02 +02:00
dependabot[bot]
271fad659c
Bump golang from 1.21.1-alpine3.17 to 1.21.2-alpine3.17
Bumps golang from 1.21.1-alpine3.17 to 1.21.2-alpine3.17.

---
updated-dependencies:
- dependency-name: golang
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-06 04:42:39 +00:00
dependabot[bot]
b25564e6b5
Bump golang.org/x/net from 0.15.0 to 0.16.0
Bumps [golang.org/x/net](https://github.com/golang/net) from 0.15.0 to 0.16.0.
- [Commits](https://github.com/golang/net/compare/v0.15.0...v0.16.0)

---
updated-dependencies:
- dependency-name: golang.org/x/net
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-06 04:24:25 +00:00
Vincent Composieux
79cea12c6a
Merge pull request #203 from eko/dependabot/go_modules/github.com/prometheus/client_golang-1.17.0
Bump github.com/prometheus/client_golang from 1.16.0 to 1.17.0
2023-09-28 08:50:59 +02:00
dependabot[bot]
baed8424df
Bump github.com/prometheus/client_golang from 1.16.0 to 1.17.0
Bumps [github.com/prometheus/client_golang](https://github.com/prometheus/client_golang) from 1.16.0 to 1.17.0.
- [Release notes](https://github.com/prometheus/client_golang/releases)
- [Changelog](https://github.com/prometheus/client_golang/blob/v1.17.0/CHANGELOG.md)
- [Commits](https://github.com/prometheus/client_golang/compare/v1.16.0...v1.17.0)

---
updated-dependencies:
- dependency-name: github.com/prometheus/client_golang
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-28 04:24:21 +00:00
Vincent Composieux
17c23872de
Merge pull request #200 from eko/dependabot/go_modules/golang.org/x/net-0.15.0
Bump golang.org/x/net from 0.14.0 to 0.15.0
2023-09-08 23:30:37 +02:00
Vincent Composieux
25b9b278c7
Merge pull request #201 from eko/dependabot/docker/golang-1.21.1-alpine3.17
Bump golang from 1.21.0-alpine3.17 to 1.21.1-alpine3.17
2023-09-08 23:30:23 +02:00
dependabot[bot]
877e724060
Bump golang from 1.21.0-alpine3.17 to 1.21.1-alpine3.17
Bumps golang from 1.21.0-alpine3.17 to 1.21.1-alpine3.17.

---
updated-dependencies:
- dependency-name: golang
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-07 04:21:13 +00:00
dependabot[bot]
1cd6e36673
Bump golang.org/x/net from 0.14.0 to 0.15.0
Bumps [golang.org/x/net](https://github.com/golang/net) from 0.14.0 to 0.15.0.
- [Commits](https://github.com/golang/net/compare/v0.14.0...v0.15.0)

---
updated-dependencies:
- dependency-name: golang.org/x/net
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-06 04:34:10 +00:00
Vincent Composieux
8e540a53c2
Merge pull request #199 from webash/webash-patch-1
Update README.md; spurious comma
2023-08-29 08:44:20 +02:00
Ashley
e68f6c37a0
Update README.md; spurious comma
Spurious comma in the example for specifying environment variables targeting multiple endpoints, but with a singular config.
2023-08-20 21:13:53 +01:00
Vincent Composieux
42b036b560
Merge pull request #197 from eko/dependabot/go_modules/golang.org/x/net-0.14.0
Bump golang.org/x/net from 0.13.0 to 0.14.0
2023-08-10 22:34:19 +02:00
Vincent Composieux
e80fd9e151
Merge pull request #198 from eko/dependabot/docker/golang-1.21.0-alpine3.17
Bump golang from 1.20.7-alpine3.17 to 1.21.0-alpine3.17
2023-08-10 22:34:08 +02:00
dependabot[bot]
6d3bf07525
Bump golang from 1.20.7-alpine3.17 to 1.21.0-alpine3.17
Bumps golang from 1.20.7-alpine3.17 to 1.21.0-alpine3.17.

---
updated-dependencies:
- dependency-name: golang
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-08-10 04:19:57 +00:00
dependabot[bot]
ebaaa73f9a
Bump golang.org/x/net from 0.13.0 to 0.14.0
Bumps [golang.org/x/net](https://github.com/golang/net) from 0.13.0 to 0.14.0.
- [Commits](https://github.com/golang/net/compare/v0.13.0...v0.14.0)

---
updated-dependencies:
- dependency-name: golang.org/x/net
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-08-07 04:32:08 +00:00
Vincent Composieux
ebbb4e6e62
Merge pull request #195 from eko/dependabot/docker/golang-1.20.7-alpine3.17
Bump golang from 1.20.6-alpine3.17 to 1.20.7-alpine3.17
2023-08-02 22:20:11 +02:00
Vincent Composieux
b26e316390
Merge pull request #196 from eko/dependabot/go_modules/golang.org/x/net-0.13.0
Bump golang.org/x/net from 0.12.0 to 0.13.0
2023-08-02 22:20:00 +02:00
dependabot[bot]
582376df22
Bump golang.org/x/net from 0.12.0 to 0.13.0
Bumps [golang.org/x/net](https://github.com/golang/net) from 0.12.0 to 0.13.0.
- [Commits](https://github.com/golang/net/compare/v0.12.0...v0.13.0)

---
updated-dependencies:
- dependency-name: golang.org/x/net
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-08-02 04:17:19 +00:00
dependabot[bot]
ef79e3b50a
Bump golang from 1.20.6-alpine3.17 to 1.20.7-alpine3.17
Bumps golang from 1.20.6-alpine3.17 to 1.20.7-alpine3.17.

---
updated-dependencies:
- dependency-name: golang
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-08-02 04:13:51 +00:00
Vincent Composieux
40a68995fe
Merge pull request #194 from darnfish/fix-caps
(style) Fix capitalisation
2023-07-27 22:23:58 +02:00
William Gibson
a222743675
Emojis are important 2023-07-26 03:15:50 -04:00
William Gibson
d148c6d95d
Fix caps 2023-07-26 03:15:44 -04:00
Vincent Composieux
4dad8e2fe3
Merge pull request #192 from eko/dependabot/docker/golang-1.20.6-alpine3.17
Bump golang from 1.20.5-alpine3.17 to 1.20.6-alpine3.17
2023-07-14 19:17:30 +02:00
dependabot[bot]
ec2233d3b0
Bump golang from 1.20.5-alpine3.17 to 1.20.6-alpine3.17
Bumps golang from 1.20.5-alpine3.17 to 1.20.6-alpine3.17.

---
updated-dependencies:
- dependency-name: golang
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-07-12 04:31:01 +00:00
Vincent Composieux
2364499928
Merge pull request #191 from eko/dependabot/go_modules/golang.org/x/net-0.12.0
Bump golang.org/x/net from 0.11.0 to 0.12.0
2023-07-09 00:13:07 +02:00
dependabot[bot]
c14187e44b
Bump golang.org/x/net from 0.11.0 to 0.12.0
Bumps [golang.org/x/net](https://github.com/golang/net) from 0.11.0 to 0.12.0.
- [Commits](https://github.com/golang/net/compare/v0.11.0...v0.12.0)

---
updated-dependencies:
- dependency-name: golang.org/x/net
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-07-06 04:47:02 +00:00
Vincent Composieux
d23863c3ac
Merge pull request #189 from eko/dependabot/go_modules/golang.org/x/net-0.11.0
Bump golang.org/x/net from 0.10.0 to 0.11.0
2023-06-17 07:33:16 +02:00
Vincent Composieux
a7666bcd4d
Merge pull request #190 from eko/dependabot/go_modules/github.com/prometheus/client_golang-1.16.0
Bump github.com/prometheus/client_golang from 1.15.1 to 1.16.0
2023-06-17 07:33:05 +02:00
dependabot[bot]
7f89d43ea5
Bump github.com/prometheus/client_golang from 1.15.1 to 1.16.0
Bumps [github.com/prometheus/client_golang](https://github.com/prometheus/client_golang) from 1.15.1 to 1.16.0.
- [Release notes](https://github.com/prometheus/client_golang/releases)
- [Changelog](https://github.com/prometheus/client_golang/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prometheus/client_golang/compare/v1.15.1...v1.16.0)

---
updated-dependencies:
- dependency-name: github.com/prometheus/client_golang
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-06-16 04:59:11 +00:00
dependabot[bot]
1a1cee2b13
Bump golang.org/x/net from 0.10.0 to 0.11.0
Bumps [golang.org/x/net](https://github.com/golang/net) from 0.10.0 to 0.11.0.
- [Commits](https://github.com/golang/net/compare/v0.10.0...v0.11.0)

---
updated-dependencies:
- dependency-name: golang.org/x/net
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-06-14 04:59:02 +00:00
Vincent Composieux
30358a561e
Merge pull request #188 from eko/dependabot/docker/golang-1.20.5-alpine3.17
Bump golang from 1.20.4-alpine3.17 to 1.20.5-alpine3.17
2023-06-10 10:41:25 +02:00
dependabot[bot]
90bcd1837c
Bump golang from 1.20.4-alpine3.17 to 1.20.5-alpine3.17
Bumps golang from 1.20.4-alpine3.17 to 1.20.5-alpine3.17.

---
updated-dependencies:
- dependency-name: golang
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-06-07 04:59:49 +00:00
Vincent Composieux
b9addb87f0
Merge pull request #187 from eko/dependabot/go_modules/github.com/sirupsen/logrus-1.9.3
Bump github.com/sirupsen/logrus from 1.9.2 to 1.9.3
2023-06-06 18:28:00 +02:00
dependabot[bot]
dfa6da32f6
Bump github.com/sirupsen/logrus from 1.9.2 to 1.9.3
Bumps [github.com/sirupsen/logrus](https://github.com/sirupsen/logrus) from 1.9.2 to 1.9.3.
- [Release notes](https://github.com/sirupsen/logrus/releases)
- [Changelog](https://github.com/sirupsen/logrus/blob/master/CHANGELOG.md)
- [Commits](https://github.com/sirupsen/logrus/compare/v1.9.2...v1.9.3)

---
updated-dependencies:
- dependency-name: github.com/sirupsen/logrus
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-06-05 05:00:15 +00:00
Vincent Composieux
329b4c6ad3
Merge pull request #186 from eko/dependabot/go_modules/github.com/stretchr/testify-1.8.4
Bump github.com/stretchr/testify from 1.8.3 to 1.8.4
2023-05-31 08:53:48 +02:00
dependabot[bot]
bcd35fffb3
Bump github.com/stretchr/testify from 1.8.3 to 1.8.4
Bumps [github.com/stretchr/testify](https://github.com/stretchr/testify) from 1.8.3 to 1.8.4.
- [Release notes](https://github.com/stretchr/testify/releases)
- [Commits](https://github.com/stretchr/testify/compare/v1.8.3...v1.8.4)

---
updated-dependencies:
- dependency-name: github.com/stretchr/testify
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-05-31 04:58:57 +00:00
Vincent Composieux
19d6849f2c
Merge pull request #185 from eko/dependabot/go_modules/github.com/stretchr/testify-1.8.3
Bump github.com/stretchr/testify from 1.8.2 to 1.8.3
2023-05-20 16:21:06 +02:00
dependabot[bot]
a8f1bc380e
Bump github.com/stretchr/testify from 1.8.2 to 1.8.3
Bumps [github.com/stretchr/testify](https://github.com/stretchr/testify) from 1.8.2 to 1.8.3.
- [Release notes](https://github.com/stretchr/testify/releases)
- [Commits](https://github.com/stretchr/testify/compare/v1.8.2...v1.8.3)

---
updated-dependencies:
- dependency-name: github.com/stretchr/testify
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-05-20 14:06:09 +00:00
Vincent Composieux
2f244188e9
Merge pull request #184 from eko/dependabot/go_modules/github.com/sirupsen/logrus-1.9.2
Bump github.com/sirupsen/logrus from 1.9.0 to 1.9.2
2023-05-20 16:05:12 +02:00
dependabot[bot]
e62cf3ce44
Bump github.com/sirupsen/logrus from 1.9.0 to 1.9.2
Bumps [github.com/sirupsen/logrus](https://github.com/sirupsen/logrus) from 1.9.0 to 1.9.2.
- [Release notes](https://github.com/sirupsen/logrus/releases)
- [Changelog](https://github.com/sirupsen/logrus/blob/master/CHANGELOG.md)
- [Commits](https://github.com/sirupsen/logrus/compare/v1.9.0...v1.9.2)

---
updated-dependencies:
- dependency-name: github.com/sirupsen/logrus
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-05-18 04:59:55 +00:00
Vincent Composieux
1818156b36
Merge pull request #182 from eko/dependabot/go_modules/golang.org/x/net-0.10.0
Bump golang.org/x/net from 0.9.0 to 0.10.0
2023-05-12 20:18:56 +02:00
dependabot[bot]
3399b2817c
Bump golang.org/x/net from 0.9.0 to 0.10.0
Bumps [golang.org/x/net](https://github.com/golang/net) from 0.9.0 to 0.10.0.
- [Commits](https://github.com/golang/net/compare/v0.9.0...v0.10.0)

---
updated-dependencies:
- dependency-name: golang.org/x/net
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-05-09 04:59:16 +00:00
Vincent Composieux
011a9c7f60
Merge pull request #181 from eko/dependabot/go_modules/github.com/prometheus/client_golang-1.15.1
Bump github.com/prometheus/client_golang from 1.15.0 to 1.15.1
2023-05-04 23:13:01 +02:00
dependabot[bot]
56d33f7b52
Bump github.com/prometheus/client_golang from 1.15.0 to 1.15.1
Bumps [github.com/prometheus/client_golang](https://github.com/prometheus/client_golang) from 1.15.0 to 1.15.1.
- [Release notes](https://github.com/prometheus/client_golang/releases)
- [Changelog](https://github.com/prometheus/client_golang/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prometheus/client_golang/compare/v1.15.0...v1.15.1)

---
updated-dependencies:
- dependency-name: github.com/prometheus/client_golang
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-05-04 04:58:57 +00:00
Vincent Composieux
f500e1bc70
Merge pull request #180 from eko/dependabot/docker/golang-1.20.4-alpine3.17
Bump golang from 1.20.3-alpine3.17 to 1.20.4-alpine3.17
2023-05-03 22:28:25 +02:00
dependabot[bot]
a8f43f8873
Bump golang from 1.20.3-alpine3.17 to 1.20.4-alpine3.17
Bumps golang from 1.20.3-alpine3.17 to 1.20.4-alpine3.17.

---
updated-dependencies:
- dependency-name: golang
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-05-03 04:58:13 +00:00
Vincent Composieux
5759f3ff42
Merge pull request #179 from zhengyi13/add-bind-addr-support
Teach pihole-exporter how to bind to a specific interface.
2023-05-02 22:11:33 +02:00
Justin M
62f51680c5 Teach pihole-exporter how to bind to a specific interface. 2023-05-01 10:02:10 -07:00
Vincent Composieux
7095927491
Merge pull request #178 from eko/dependabot/go_modules/github.com/prometheus/client_golang-1.15.0
Bump github.com/prometheus/client_golang from 1.14.0 to 1.15.0
2023-04-15 07:43:39 +02:00
dependabot[bot]
5d5a5fc2c4
Bump github.com/prometheus/client_golang from 1.14.0 to 1.15.0
Bumps [github.com/prometheus/client_golang](https://github.com/prometheus/client_golang) from 1.14.0 to 1.15.0.
- [Release notes](https://github.com/prometheus/client_golang/releases)
- [Changelog](https://github.com/prometheus/client_golang/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prometheus/client_golang/compare/v1.14.0...v1.15.0)

---
updated-dependencies:
- dependency-name: github.com/prometheus/client_golang
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-04-14 04:59:00 +00:00
Vincent Composieux
f07519d156
Merge pull request #177 from eko/dependabot/go_modules/golang.org/x/net-0.9.0
Bump golang.org/x/net from 0.8.0 to 0.9.0
2023-04-09 13:11:43 +02:00
dependabot[bot]
d1c7b6b4b1
Bump golang.org/x/net from 0.8.0 to 0.9.0
Bumps [golang.org/x/net](https://github.com/golang/net) from 0.8.0 to 0.9.0.
- [Release notes](https://github.com/golang/net/releases)
- [Commits](https://github.com/golang/net/compare/v0.8.0...v0.9.0)

---
updated-dependencies:
- dependency-name: golang.org/x/net
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-04-07 04:59:04 +00:00
Vincent Composieux
cbd6d6a8d0
Merge pull request #176 from eko/dependabot/docker/golang-1.20.3-alpine3.17
Bump golang from 1.20.2-alpine3.17 to 1.20.3-alpine3.17
2023-04-06 20:59:22 +02:00
dependabot[bot]
2012afabd6
Bump golang from 1.20.2-alpine3.17 to 1.20.3-alpine3.17
Bumps golang from 1.20.2-alpine3.17 to 1.20.3-alpine3.17.

---
updated-dependencies:
- dependency-name: golang
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-04-05 04:58:39 +00:00
Vincent Composieux
1fc54ccd98
Merge pull request #173 from eko/dependabot/docker/golang-1.20.2-alpine3.17
Bump golang from 1.20.1-alpine3.17 to 1.20.2-alpine3.17
2023-03-08 07:30:15 +01:00
dependabot[bot]
458eaa2f3a
Bump golang from 1.20.1-alpine3.17 to 1.20.2-alpine3.17
Bumps golang from 1.20.1-alpine3.17 to 1.20.2-alpine3.17.

---
updated-dependencies:
- dependency-name: golang
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-03-08 04:58:45 +00:00
Vincent Composieux
3bda445b63
Merge pull request #172 from eko/dependabot/go_modules/golang.org/x/net-0.8.0
Bump golang.org/x/net from 0.7.0 to 0.8.0
2023-03-07 20:20:37 +01:00
dependabot[bot]
f6f173e096
Bump golang.org/x/net from 0.7.0 to 0.8.0
Bumps [golang.org/x/net](https://github.com/golang/net) from 0.7.0 to 0.8.0.
- [Release notes](https://github.com/golang/net/releases)
- [Commits](https://github.com/golang/net/compare/v0.7.0...v0.8.0)

---
updated-dependencies:
- dependency-name: golang.org/x/net
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-03-06 05:02:14 +00:00
13 changed files with 100 additions and 97 deletions

View file

@ -1,6 +1,6 @@
# Contributing
PI-Hole exporter is an open source project, completely opened to be a community-driven project.
Pi-hole exporter is an open source project, completely opened to be a community-driven project.
If you'd like to contribute, you are free to do so.

View file

@ -2,7 +2,7 @@ ARG IMAGE=scratch
ARG OS=linux
ARG ARCH=amd64
FROM golang:1.20.1-alpine3.17 as builder
FROM golang:1.21.2-alpine3.17 as builder
WORKDIR /go/src/github.com/eko/pihole-exporter
COPY . .

View file

@ -1,10 +1,10 @@
# PI-Hole Prometheus Exporter
# Pi-hole Prometheus Exporter
![Build/Push (master)](https://github.com/eko/pihole-exporter/workflows/Build/Push%20(master)/badge.svg)
[![GoDoc](https://godoc.org/github.com/eko/pihole-exporter?status.png)](https://godoc.org/github.com/eko/pihole-exporter)
[![GoReportCard](https://goreportcard.com/badge/github.com/eko/pihole-exporter)](https://goreportcard.com/report/github.com/eko/pihole-exporter)
This is a Prometheus exporter for [PI-Hole](https://pi-hole.net/)'s Raspberry PI ad blocker.
This is a Prometheus exporter for [Pi-hole](https://pi-hole.net/)'s Raspberry PI ad blocker.
![Grafana dashboard](https://raw.githubusercontent.com/eko/pihole-exporter/master/dashboard.jpg)
@ -95,7 +95,7 @@ If port, protocol and API token/password is the same for all instances, you can
```
$ docker run \
-e 'PIHOLE_PROTOCOL=,http" \
-e 'PIHOLE_PROTOCOL=http" \
-e 'PIHOLE_HOSTNAME=192.168.1.2,192.168.1.3,192.168.1.4"' \
-e "PIHOLE_API_TOKEN=$API_TOKEN" \
-e "PIHOLE_PORT=8080" \
@ -143,7 +143,7 @@ $ ./pihole_exporter -pihole_hostname 192.168.1.10 -pihole_api_token $API_TOKEN
```bash
2019/05/09 20:19:52 ------------------------------------
2019/05/09 20:19:52 - PI-Hole exporter configuration -
2019/05/09 20:19:52 - Pi-hole exporter configuration -
2019/05/09 20:19:52 ------------------------------------
2019/05/09 20:19:52 PIHoleHostname : 192.168.1.10
2019/05/09 20:19:52 PIHolePassword : azerty
@ -183,18 +183,21 @@ scrape_configs:
## Available CLI options
```bash
# Hostname of the host(s) where PI-Hole is installed
# Hostname of the host(s) where Pi-hole is installed
-pihole_hostname string (optional) (default "127.0.0.1")
# Password defined on the PI-Hole interface
# Password defined on the Pi-hole interface
-pihole_password string (optional)
# Timeout to connect and retrieve data from a Pi-Hole instance
# Timeout to connect and retrieve data from a Pi-hole instance
-timeout duration (optional) (default 5s)
# WEBPASSWORD / api token defined on the PI-Hole interface at `/etc/pihole/setupVars.conf`
# WEBPASSWORD / api token defined on the Pi-hole interface at `/etc/pihole/setupVars.conf`
-pihole_api_token string (optional)
# Address to be used for the exporter
-bind_addr string (optional) (default "0.0.0.0")
# Port to be used for the exporter
-port string (optional) (default "9617")
```
@ -214,12 +217,12 @@ scrape_configs:
| pihole_unique_clients | This represent the number of unique clients seen |
| pihole_dns_queries_all_types | This represent the number of DNS queries made for all types |
| pihole_reply | This represent the number of replies made for all types |
| pihole_top_queries | This represent the number of top queries made by PI-Hole by domain |
| pihole_top_ads | This represent the number of top ads made by PI-Hole by domain |
| pihole_top_sources | This represent the number of top sources requests made by PI-Hole by source host |
| pihole_forward_destinations | This represent the number of forward destinations requests made by PI-Hole by destination |
| pihole_querytypes | This represent the number of queries made by PI-Hole by type |
| pihole_status | This represent if PI-Hole is enabled |
| pihole_top_queries | This represent the number of top queries made by Pi-hole by domain |
| pihole_top_ads | This represent the number of top ads made by Pi-hole by domain |
| pihole_top_sources | This represent the number of top sources requests made by Pi-hole by source host |
| pihole_forward_destinations | This represent the number of forward destinations requests made by Pi-hole by destination |
| pihole_querytypes | This represent the number of queries made by Pi-hole by type |
| pihole_status | This represent if Pi-hole is enabled |
## Pihole-Exporter Helm Chart

View file

@ -24,6 +24,8 @@ type Config struct {
PIHolePort uint16 `config:"pihole_port"`
PIHolePassword string `config:"pihole_password"`
PIHoleApiToken string `config:"pihole_api_token"`
BindAddr string `config:"bind_addr"`
Port uint16 `config:"port"`
}
type EnvConfig struct {
@ -32,6 +34,7 @@ type EnvConfig struct {
PIHolePort []uint16 `config:"pihole_port"`
PIHolePassword []string `config:"pihole_password"`
PIHoleApiToken []string `config:"pihole_api_token"`
BindAddr string `config:"bind_addr"`
Port uint16 `config:"port"`
Timeout time.Duration `config:"timeout"`
}
@ -43,6 +46,7 @@ func getDefaultEnvConfig() *EnvConfig {
PIHolePort: []uint16{80},
PIHolePassword: []string{},
PIHoleApiToken: []string{},
BindAddr: "0.0.0.0",
Port: 9617,
Timeout: 5 * time.Second,
}
@ -190,7 +194,7 @@ func (c Config) PIHoleLoginURL() string {
func (c EnvConfig) show() {
val := reflect.ValueOf(&c).Elem()
log.Info("------------------------------------")
log.Info("- PI-Hole exporter configuration -")
log.Info("- Pi-hole exporter configuration -")
log.Info("------------------------------------")
log.Info("Go version: ", runtime.Version())
for i := 0; i < val.NumField(); i++ {
@ -209,6 +213,6 @@ func (c EnvConfig) show() {
func showAuthenticationMethod(name string, length int) {
if length > 0 {
log.Info(fmt.Sprintf("Pi-Hole Authentication Method : %s", name))
log.Info(fmt.Sprintf("Pi-hole Authentication Method : %s", name))
}
}

20
go.mod
View file

@ -4,25 +4,25 @@ go 1.20
require (
github.com/heetch/confita v0.10.0
github.com/prometheus/client_golang v1.14.0
github.com/sirupsen/logrus v1.9.0
github.com/stretchr/testify v1.8.2
github.com/prometheus/client_golang v1.17.0
github.com/sirupsen/logrus v1.9.3
github.com/stretchr/testify v1.8.4
github.com/xonvanetta/shutdown v0.0.3
golang.org/x/net v0.7.0
golang.org/x/net v0.16.0
)
require (
github.com/beorn7/perks v1.0.1 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/prometheus/client_model v0.3.0 // indirect
github.com/prometheus/common v0.41.0 // indirect
github.com/prometheus/procfs v0.9.0 // indirect
golang.org/x/sys v0.5.0 // indirect
google.golang.org/protobuf v1.28.1 // indirect
github.com/prometheus/client_model v0.4.1-0.20230718164431-9a2bf3000d16 // indirect
github.com/prometheus/common v0.44.0 // indirect
github.com/prometheus/procfs v0.11.1 // indirect
golang.org/x/sys v0.13.0 // indirect
google.golang.org/protobuf v1.31.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)

48
go.sum
View file

@ -42,10 +42,9 @@ github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4er
github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk=
github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw=
github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg=
github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
@ -96,8 +95,8 @@ github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22
github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w=
github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc=
github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI=
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
@ -134,44 +133,41 @@ github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndr
github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw=
github.com/prometheus/client_golang v0.9.2/go.mod h1:OsXs2jCmiKlQ1lTBmv21f2mNfw4xf/QclQDMrYNZzcM=
github.com/prometheus/client_golang v0.9.3-0.20190127221311-3c4408c8b829/go.mod h1:p2iRAGwDERtqlqzRXnrOVns+ignqQo//hLXqYxZYVNs=
github.com/prometheus/client_golang v1.14.0 h1:nJdhIvne2eSX/XRAFV9PcvFFRbrjbcTUj0VP62TMhnw=
github.com/prometheus/client_golang v1.14.0/go.mod h1:8vpkKitgIVNcqrRBWh1C4TIUQgYNtG/XQE4E/Zae36Y=
github.com/prometheus/client_golang v1.17.0 h1:rl2sfwZMtSthVU752MqfjQozy7blglC+1SOtjMAMh+Q=
github.com/prometheus/client_golang v1.17.0/go.mod h1:VeL+gMmOAxkS2IqfCq0ZmHSL+LjWfWDUmp1mBz9JgUY=
github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo=
github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo=
github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
github.com/prometheus/client_model v0.3.0 h1:UBgGFHqYdG/TPFD1B1ogZywDqEkwp3fBMvqdiQ7Xew4=
github.com/prometheus/client_model v0.3.0/go.mod h1:LDGWKZIo7rky3hgvBe+caln+Dr3dPggB5dvjtD7w9+w=
github.com/prometheus/client_model v0.4.1-0.20230718164431-9a2bf3000d16 h1:v7DLqVdK4VrYkVD5diGdl4sxJurKJEMnODWRJlxV9oM=
github.com/prometheus/client_model v0.4.1-0.20230718164431-9a2bf3000d16/go.mod h1:oMQmHW1/JoDwqLtg57MGgP/Fb1CJEYF2imWWhWtMkYU=
github.com/prometheus/common v0.0.0-20181126121408-4724e9255275/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro=
github.com/prometheus/common v0.2.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4=
github.com/prometheus/common v0.41.0 h1:npo01n6vUlRViIj5fgwiK8vlNIh8bnoxqh3gypKsyAw=
github.com/prometheus/common v0.41.0/go.mod h1:xBwqVerjNdUDjgODMpudtOMwlOwf2SaTr1yjz4b7Zbc=
github.com/prometheus/common v0.44.0 h1:+5BrQJwiBB9xsMygAB3TNvpQKOwlkc25LbISbrdOOfY=
github.com/prometheus/common v0.44.0/go.mod h1:ofAIvZbQ1e/nugmZGz4/qCb9Ap1VoSTIO7x0VV9VvuY=
github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
github.com/prometheus/procfs v0.0.0-20181204211112-1dc9a6cbc91a/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
github.com/prometheus/procfs v0.9.0 h1:wzCHvIvM5SxWqYvwgVL7yJY8Lz3PKn49KQtpgMYJfhI=
github.com/prometheus/procfs v0.9.0/go.mod h1:+pB4zwohETzFnmlpe6yd2lSc+0/46IYZRB/chUwxUZY=
github.com/prometheus/procfs v0.11.1 h1:xRC8Iq1yyca5ypa9n1EZnWZkt7dwcoRPQwX/5gwaUuI=
github.com/prometheus/procfs v0.11.1/go.mod h1:eesXgaPo1q7lBpVMoMy0ZOFTth9hBn4W/y0/p/ScXhY=
github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg=
github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ=
github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts=
github.com/ryanuber/columnize v2.1.0+incompatible/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts=
github.com/ryanuber/go-glob v1.0.0/go.mod h1:807d1WSdnB0XRJzKNil9Om6lcp/3a0v4qIHxIXzX/Yc=
github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc=
github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo=
github.com/sirupsen/logrus v1.9.0 h1:trlNQbNUG3OdDrDil03MCb1H2o9nJ1x4/5LYw7byDE0=
github.com/sirupsen/logrus v1.9.0/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=
github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ=
github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=
github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
github.com/stretchr/testify v1.6.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8=
github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U=
github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM=
github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc=
@ -198,8 +194,8 @@ golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73r
golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.7.0 h1:rJrUqqhjsgNp7KqAIc25s9pZnjU7TUcSY7HcVZjdn1g=
golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
golang.org/x/net v0.16.0 h1:7eBu7KsSvFDtSXUIDbh3aqlK4DPsZ1rByC8PFfBThos=
golang.org/x/net v0.16.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
@ -218,8 +214,8 @@ golang.org/x/sys v0.0.0-20190403152447-81d4e9dc473e/go.mod h1:h1NjWce9XRLGQEsW7w
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190508220229-2d0786266e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.5.0 h1:MUK/U/4lj1t1oPg0HfuXDN/Z1wv31ZJ/YcPiGccS4DU=
golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE=
golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.1-0.20181227161524-e6919f6577db/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
@ -238,8 +234,8 @@ google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZi
google.golang.org/grpc v1.22.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg=
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
google.golang.org/protobuf v1.28.1 h1:d0NfwRgPtno5B1Wa6L2DAG+KivqkdutMf1UhdNx175w=
google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8=
google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw=
gopkg.in/asn1-ber.v1 v1.0.0-20181015200546-f715ec2f112d/go.mod h1:cuepJuh7vyXfUyUwEgHQXw849cJrilpS5NeIjOWESAw=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=

View file

@ -76,7 +76,7 @@
}
]
},
"description": "This is a PI-Hole dashboard when using the https://github.com/eko/pihole-exporter Prometheus exporter with an Influxdb2 Datasource",
"description": "This is a Pi-hole dashboard when using the https://github.com/eko/pihole-exporter Prometheus exporter with an Influxdb2 Datasource",
"editable": true,
"fiscalYearStartMonth": 0,
"gnetId": 17094,
@ -108,7 +108,7 @@
"refId": "A"
}
],
"title": "🍓PI-Hole",
"title": "🥧🕳️ Pi-hole",
"type": "row"
},
{
@ -1777,7 +1777,7 @@
]
},
"timezone": "",
"title": "PI-Hole Exporter Influxdb 2 (Flux)",
"title": "Pi-hole Exporter Influxdb 2 (Flux)",
"uid": "KILVhlozd",
"version": 1,
"weekStart": ""

View file

@ -67,7 +67,7 @@
}
]
},
"description": "This is a PI-Hole dashboard when using the https://github.com/eko/pihole-exporter Prometheus exporter",
"description": "This is a Pi-hole dashboard when using the https://github.com/eko/pihole-exporter Prometheus exporter",
"editable": true,
"gnetId": 10176,
"graphTooltip": 0,
@ -86,7 +86,7 @@
},
"id": 60,
"panels": [],
"title": "🍓PI-Hole",
"title": "🥧🕳️ Pi-hole",
"type": "row"
},
{
@ -1522,7 +1522,7 @@
]
},
"timezone": "",
"title": "PI-Hole Exporter",
"uid": "PI-Hole-Exporter",
"title": "Pi-hole Exporter",
"uid": "Pi-hole-Exporter",
"version": 31
}

View file

@ -6,7 +6,7 @@ import (
)
var (
// DomainsBlocked - The number of domains being blocked by PI-Hole.
// DomainsBlocked - The number of domains being blocked by Pi-hole.
DomainsBlocked = prometheus.NewGaugeVec(
prometheus.GaugeOpts{
Name: "domains_being_blocked",
@ -16,7 +16,7 @@ var (
[]string{"hostname"},
)
// DNSQueriesToday - The number of DNS requests made over PI-Hole over the current day.
// DNSQueriesToday - The number of DNS requests made over Pi-hole over the current day.
DNSQueriesToday = prometheus.NewGaugeVec(
prometheus.GaugeOpts{
Name: "dns_queries_today",
@ -26,7 +26,7 @@ var (
[]string{"hostname"},
)
// AdsBlockedToday - The number of ads blocked by PI-Hole over the current day.
// AdsBlockedToday - The number of ads blocked by Pi-hole over the current day.
AdsBlockedToday = prometheus.NewGaugeVec(
prometheus.GaugeOpts{
Name: "ads_blocked_today",
@ -36,7 +36,7 @@ var (
[]string{"hostname"},
)
// AdsPercentageToday - The percentage of ads blocked by PI-Hole over the current day.
// AdsPercentageToday - The percentage of ads blocked by Pi-hole over the current day.
AdsPercentageToday = prometheus.NewGaugeVec(
prometheus.GaugeOpts{
Name: "ads_percentage_today",
@ -46,7 +46,7 @@ var (
[]string{"hostname"},
)
// UniqueDomains - The number of unique domains seen by PI-Hole.
// UniqueDomains - The number of unique domains seen by Pi-hole.
UniqueDomains = prometheus.NewGaugeVec(
prometheus.GaugeOpts{
Name: "unique_domains",
@ -56,7 +56,7 @@ var (
[]string{"hostname"},
)
// QueriesForwarded - The number of queries forwarded by PI-Hole.
// QueriesForwarded - The number of queries forwarded by Pi-hole.
QueriesForwarded = prometheus.NewGaugeVec(
prometheus.GaugeOpts{
Name: "queries_forwarded",
@ -66,7 +66,7 @@ var (
[]string{"hostname"},
)
// QueriesCached - The number of queries cached by PI-Hole.
// QueriesCached - The number of queries cached by Pi-hole.
QueriesCached = prometheus.NewGaugeVec(
prometheus.GaugeOpts{
Name: "queries_cached",
@ -76,7 +76,7 @@ var (
[]string{"hostname"},
)
// ClientsEverSeen - The number of clients ever seen by PI-Hole.
// ClientsEverSeen - The number of clients ever seen by Pi-hole.
ClientsEverSeen = prometheus.NewGaugeVec(
prometheus.GaugeOpts{
Name: "clients_ever_seen",
@ -86,7 +86,7 @@ var (
[]string{"hostname"},
)
// UniqueClients - The number of unique clients seen by PI-Hole.
// UniqueClients - The number of unique clients seen by Pi-hole.
UniqueClients = prometheus.NewGaugeVec(
prometheus.GaugeOpts{
Name: "unique_clients",
@ -96,7 +96,7 @@ var (
[]string{"hostname"},
)
// DNSQueriesAllTypes - The number of DNS queries made for all types by PI-Hole.
// DNSQueriesAllTypes - The number of DNS queries made for all types by Pi-hole.
DNSQueriesAllTypes = prometheus.NewGaugeVec(
prometheus.GaugeOpts{
Name: "dns_queries_all_types",
@ -106,7 +106,7 @@ var (
[]string{"hostname"},
)
// Reply - The number of replies made for every types by PI-Hole.
// Reply - The number of replies made for every types by Pi-hole.
Reply = prometheus.NewGaugeVec(
prometheus.GaugeOpts{
Name: "reply",
@ -116,68 +116,68 @@ var (
[]string{"hostname", "type"},
)
// TopQueries - The number of top queries made by PI-Hole by domain.
// TopQueries - The number of top queries made by Pi-hole by domain.
TopQueries = prometheus.NewGaugeVec(
prometheus.GaugeOpts{
Name: "top_queries",
Namespace: "pihole",
Help: "This represent the number of top queries made by PI-Hole by domain",
Help: "This represent the number of top queries made by Pi-hole by domain",
},
[]string{"hostname", "domain"},
)
// TopAds - The number of top ads made by PI-Hole by domain.
// TopAds - The number of top ads made by Pi-hole by domain.
TopAds = prometheus.NewGaugeVec(
prometheus.GaugeOpts{
Name: "top_ads",
Namespace: "pihole",
Help: "This represent the number of top ads made by PI-Hole by domain",
Help: "This represent the number of top ads made by Pi-hole by domain",
},
[]string{"hostname", "domain"},
)
// TopSources - The number of top sources requests made by PI-Hole by source host.
// TopSources - The number of top sources requests made by Pi-hole by source host.
TopSources = prometheus.NewGaugeVec(
prometheus.GaugeOpts{
Name: "top_sources",
Namespace: "pihole",
Help: "This represent the number of top sources requests made by PI-Hole by source host",
Help: "This represent the number of top sources requests made by Pi-hole by source host",
},
[]string{"hostname", "source"},
)
// ForwardDestinations - The number of forward destinations requests made by PI-Hole by destination.
// ForwardDestinations - The number of forward destinations requests made by Pi-hole by destination.
ForwardDestinations = prometheus.NewGaugeVec(
prometheus.GaugeOpts{
Name: "forward_destinations",
Namespace: "pihole",
Help: "This represent the number of forward destinations requests made by PI-Hole by destination",
Help: "This represent the number of forward destinations requests made by Pi-hole by destination",
},
[]string{"hostname", "destination"},
)
// QueryTypes - The number of queries made by PI-Hole by type.
// QueryTypes - The number of queries made by Pi-hole by type.
QueryTypes = prometheus.NewGaugeVec(
prometheus.GaugeOpts{
Name: "querytypes",
Namespace: "pihole",
Help: "This represent the number of queries made by PI-Hole by type",
Help: "This represent the number of queries made by Pi-hole by type",
},
[]string{"hostname", "type"},
)
// Status - Is PI-Hole enabled?
// Status - Is Pi-hole enabled?
Status = prometheus.NewGaugeVec(
prometheus.GaugeOpts{
Name: "status",
Namespace: "pihole",
Help: "This if PI-Hole is enabled",
Help: "This if Pi-hole is enabled",
},
[]string{"hostname"},
)
)
// Init initializes all Prometheus metrics made available by PI-Hole exporter.
// Init initializes all Prometheus metrics made available by Pi-hole exporter.
func Init() {
initMetric("domains_blocked", DomainsBlocked)
initMetric("dns_queries_today", DNSQueriesToday)

View file

@ -43,7 +43,7 @@ func (c *ClientChannel) String() string {
}
}
// Client struct is a PI-Hole client to request an instance of a PI-Hole ad blocker.
// Client struct is a Pi-hole client to request an instance of a Pi-hole ad blocker.
type Client struct {
httpClient http.Client
interval time.Duration
@ -51,7 +51,7 @@ type Client struct {
Status chan *ClientChannel
}
// NewClient method initializes a new PI-Hole client.
// NewClient method initializes a new Pi-hole client.
func NewClient(config *config.Config, envConfig *config.EnvConfig) *Client {
err := config.Validate()
if err != nil {
@ -135,10 +135,10 @@ func (c *Client) setMetrics(stats *Stats) {
}
metrics.Status.WithLabelValues(c.config.PIHoleHostname).Set(float64(isEnabled))
// Pi-Hole returns a subset of stats when Auth is missing or incorrect.
// Pi-hole returns a subset of stats when Auth is missing or incorrect.
// This provides a warning to users that metrics are not complete.
if len(stats.TopQueries) == 0 {
log.Warnf("Invalid Authentication - Some metrics may be missing. Please confirm your PI-Hole API token / Password for %s", c.config.PIHoleHostname)
log.Warnf("Invalid Authentication - Some metrics may be missing. Please confirm your Pi-hole API token / Password for %s", c.config.PIHoleHostname)
}
for domain, value := range stats.TopQueries {
@ -175,7 +175,7 @@ func (c *Client) getPHPSessionID() (sessionID string) {
resp, err := c.httpClient.Do(req)
if err != nil {
log.Errorf("An error has occured during login to PI-Hole: %v", err)
log.Errorf("An error has occured during login to Pi-hole: %v", err)
}
for _, cookie := range resp.Cookies() {
@ -208,18 +208,18 @@ func (c *Client) getStatistics() (*Stats, error) {
resp, err := c.httpClient.Do(req)
if err != nil {
return nil, fmt.Errorf("an error has occured during retrieving PI-Hole statistics: %w", err)
return nil, fmt.Errorf("an error has occured during retrieving Pi-hole statistics: %w", err)
}
defer resp.Body.Close()
body, err := ioutil.ReadAll(resp.Body)
if err != nil {
return nil, fmt.Errorf("unable to read PI-Hole statistics HTTP response: %w", err)
return nil, fmt.Errorf("unable to read Pi-hole statistics HTTP response: %w", err)
}
err = json.Unmarshal(body, stats)
if err != nil {
return nil, fmt.Errorf("unable to unmarshal PI-Hole statistics to statistics struct model: %w", err)
return nil, fmt.Errorf("unable to unmarshal Pi-hole statistics to statistics struct model: %w", err)
}
return stats, nil

View file

@ -6,7 +6,7 @@ const (
enabledStatus = "enabled"
)
// Stats struct is the PI-Hole statistics JSON API corresponding model.
// Stats struct is the Pi-hole statistics JSON API corresponding model.
type Stats struct {
DomainsBeingBlocked int `json:"domains_being_blocked"`
DNSQueriesToday int `json:"dns_queries_today"`

View file

@ -20,10 +20,10 @@ type Server struct {
// NewServer method initializes a new HTTP server instance and associates
// the different routes that will be used by Prometheus (metrics) or for monitoring (readiness, liveness).
func NewServer(port uint16, clients []*pihole.Client) *Server {
func NewServer(addr string, port uint16, clients []*pihole.Client) *Server {
mux := http.NewServeMux()
httpServer := &http.Server{
Addr: ":" + strconv.Itoa(int(port)),
Addr: addr + ":" + strconv.Itoa(int(port)),
Handler: mux,
}

View file

@ -22,7 +22,7 @@ func main() {
clients := buildClients(clientConfigs, envConf)
s := server.NewServer(envConf.Port, clients)
s := server.NewServer(envConf.BindAddr, envConf.Port, clients)
go func() {
s.ListenAndServe()
close(serverDead)