Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PI-Hole statistics to statistics struct model: invalid character 'p' after top-level value #108

Open
sanfx opened this issue Jan 1, 2022 · 1 comment

Comments

@sanfx
Copy link

sanfx commented Jan 1, 2022

When I am trying to run this exporter version ekofr/pihole-exporter:v0.1.1 using docker I am getting some errrors shown in the log which seems to resulting no data getting scraped.

pihole_doh_pihole_exporter.1.yyehqvcrodnw@swarm-master    | Creating client with config <Config@C0000A0260 PIHoleProtocol=http, PIHoleHostname=192.168.1.152, PIHolePort=80, PIHolePassword=piHole123, PIHoleApiToken=>
pihole_doh_pihole_exporter.1.yyehqvcrodnw@swarm-master    | 2022/01/01 02:43:04 ------------------------------------
pihole_doh_pihole_exporter.1.yyehqvcrodnw@swarm-master    | 2022/01/01 02:43:04 -  PI-Hole exporter configuration  -
pihole_doh_pihole_exporter.1.yyehqvcrodnw@swarm-master    | 2022/01/01 02:43:04 ------------------------------------
pihole_doh_pihole_exporter.1.yyehqvcrodnw@swarm-master    | 2022/01/01 02:43:04 PIHoleProtocol : [http]
pihole_doh_pihole_exporter.1.yyehqvcrodnw@swarm-master    | 2022/01/01 02:43:04 PIHoleHostname : [192.168.1.12]
pihole_doh_pihole_exporter.1.yyehqvcrodnw@swarm-master    | 2022/01/01 02:43:04 PIHolePort : [80]
pihole_doh_pihole_exporter.1.yyehqvcrodnw@swarm-master    | 2022/01/01 02:43:04 Pi-Hole Authentication Method : PIHolePassword
pihole_doh_pihole_exporter.1.yyehqvcrodnw@swarm-master    | 2022/01/01 02:43:04 Port : 9617
pihole_doh_pihole_exporter.1.yyehqvcrodnw@swarm-master    | 2022/01/01 02:43:04 Interval : 10s
pihole_doh_pihole_exporter.1.yyehqvcrodnw@swarm-master    | 2022/01/01 02:43:04 ------------------------------------
pihole_doh_pihole_exporter.1.yyehqvcrodnw@swarm-master    | 2022/01/01 02:43:04 New Prometheus metric registered: domains_blocked
pihole_doh_pihole_exporter.1.yyehqvcrodnw@swarm-master    | 2022/01/01 02:43:04 New Prometheus metric registered: dns_queries_today
pihole_doh_pihole_exporter.1.yyehqvcrodnw@swarm-master    | 2022/01/01 02:43:04 New Prometheus metric registered: ads_blocked_today
pihole_doh_pihole_exporter.1.yyehqvcrodnw@swarm-master    | 2022/01/01 02:43:04 New Prometheus metric registered: ads_percentag_today
pihole_doh_pihole_exporter.1.yyehqvcrodnw@swarm-master    | 2022/01/01 02:43:04 New Prometheus metric registered: unique_domains
pihole_doh_pihole_exporter.1.yyehqvcrodnw@swarm-master    | 2022/01/01 02:43:04 New Prometheus metric registered: queries_forwarded
pihole_doh_pihole_exporter.1.yyehqvcrodnw@swarm-master    | 2022/01/01 02:43:04 New Prometheus metric registered: queries_cached
pihole_doh_pihole_exporter.1.yyehqvcrodnw@swarm-master    | 2022/01/01 02:43:04 New Prometheus metric registered: clients_ever_seen
pihole_doh_pihole_exporter.1.yyehqvcrodnw@swarm-master    | 2022/01/01 02:43:04 New Prometheus metric registered: unique_clients
pihole_doh_pihole_exporter.1.yyehqvcrodnw@swarm-master    | 2022/01/01 02:43:04 New Prometheus metric registered: dns_queries_all_types
pihole_doh_pihole_exporter.1.yyehqvcrodnw@swarm-master    | 2022/01/01 02:43:04 New Prometheus metric registered: reply
pihole_doh_pihole_exporter.1.yyehqvcrodnw@swarm-master    | 2022/01/01 02:43:04 New Prometheus metric registered: top_queries
pihole_doh_pihole_exporter.1.yyehqvcrodnw@swarm-master    | 2022/01/01 02:43:04 New Prometheus metric registered: top_ads
pihole_doh_pihole_exporter.1.yyehqvcrodnw@swarm-master    | 2022/01/01 02:43:04 New Prometheus metric registered: top_sources
pihole_doh_pihole_exporter.1.yyehqvcrodnw@swarm-master    | 2022/01/01 02:43:04 New Prometheus metric registered: forward_destinations
pihole_doh_pihole_exporter.1.yyehqvcrodnw@swarm-master    | 2022/01/01 02:43:04 New Prometheus metric registered: querytypes
pihole_doh_pihole_exporter.1.yyehqvcrodnw@swarm-master    | 2022/01/01 02:43:04 New Prometheus metric registered: status
pihole_doh_pihole_exporter.1.yyehqvcrodnw@swarm-master    | 2022/01/01 02:43:04 Starting HTTP server
pihole_doh_pihole_exporter.1.yyehqvcrodnw@swarm-master    | Error unable to unmarshal PI-Hole statistics to statistics struct model: invalid character 'p' after top-level value
pihole_doh_pihole_exporter.1.yyehqvcrodnw@swarm-master    | 2022/01/01 02:43:14 http: superfluous response.WriteHeader call from github.com/prometheus/client_golang/prometheus/promhttp.(*responseWriterDelegator).WriteHeader (delegator.go:65)
pihole_doh_pihole_exporter.1.yyehqvcrodnw@swarm-master    | Error unable to unmarshal PI-Hole statistics to statistics struct model: invalid character 'p' after top-level value
pihole_doh_pihole_exporter.1.yyehqvcrodnw@swarm-master    | 2022/01/01 02:43:29 http: superfluous response.WriteHeader call from github.com/prometheus/client_golang/prometheus/promhttp.(*responseWriterDelegator).WriteHeader (delegator.go:65)
pihole_doh_pihole_exporter.1.yyehqvcrodnw@swarm-master    | Error unable to unmarshal PI-Hole statistics to statistics struct model: invalid character 'p' after top-level value
pihole_doh_pihole_exporter.1.yyehqvcrodnw@swarm-master    | 2022/01/01 02:44:42 http: superfluous response.WriteHeader call from github.com/prometheus/client_golang/prometheus/promhttp.(*responseWriterDelegator).WriteHeader (delegator.go:65)
pihole_doh_pihole_exporter.1.yyehqvcrodnw@swarm-master    | Error unable to unmarshal PI-Hole statistics to statistics struct model: invalid character 'p' after top-level value
pihole_doh_pihole_exporter.1.yyehqvcrodnw@swarm-master    | 2022/01/01 02:44:57 http: superfluous response.WriteHeader call from github.com/prometheus/client_golang/prometheus/promhttp.(*responseWriterDelegator).WriteHeader (delegator.go:65)
pihole_doh_pihole_exporter.1.yyehqvcrodnw@swarm-master    | Error unable to unmarshal PI-Hole statistics to statistics struct model: invalid character 'p' after top-level value
pihole_doh_pihole_exporter.1.yyehqvcrodnw@swarm-master    | 2022/01/01 02:45:12 http: superfluous response.WriteHeader call from github.com/prometheus/client_golang/prometheus/promhttp.(*responseWriterDelegator).WriteHeader (delegator.go:65)
pihole_doh_pihole_exporter.1.yyehqvcrodnw@swarm-master    | Error unable to unmarshal PI-Hole statistics to statistics struct model: invalid character 'p' after top-level value
pihole_doh_pihole_exporter.1.yyehqvcrodnw@swarm-master    | 2022/01/01 02:45:27 http: superfluous response.WriteHeader call from github.com/prometheus/client_golang/prometheus/promhttp.(*responseWriterDelegator).WriteHeader (delegator.go:65)
pihole_doh_pihole_exporter.1.yyehqvcrodnw@swarm-master    | Error unable to unmarshal PI-Hole statistics to statistics struct model: invalid character 'p' after top-level value
pihole_doh_pihole_exporter.1.yyehqvcrodnw@swarm-master    | 2022/01/01 02:45:42 http: superfluous response.WriteHeader call from github.com/prometheus/client_golang/prometheus/promhttp.(*responseWriterDelegator).WriteHeader (delegator.go:65)
pihole_doh_pihole_exporter.1.yyehqvcrodnw@swarm-master    | Error unable to unmarshal PI-Hole statistics to statistics struct model: invalid character 'p' after top-level value
pihole_doh_pihole_exporter.1.yyehqvcrodnw@swarm-master    | 2022/01/01 02:45:57 http: superfluous response.WriteHeader call from github.com/prometheus/client_golang/prometheus/promhttp.(*responseWriterDelegator).WriteHeader (delegator.go:65)
pihole_doh_pihole_exporter.1.yyehqvcrodnw@swarm-master    | Error unable to unmarshal PI-Hole statistics to statistics struct model: invalid character 'p' after top-level value
pihole_doh_pihole_exporter.1.yyehqvcrodnw@swarm-master    | 2022/01/01 02:46:12 http: superfluous response.WriteHeader call from github.com/prometheus/client_golang/prometheus/promhttp.(*responseWriterDelegator).WriteHeader (delegator.go:65)
pihole_doh_pihole_exporter.1.yyehqvcrodnw@swarm-master    | Error unable to unmarshal PI-Hole statistics to statistics struct model: invalid character 'p' after top-level value
pihole_doh_pihole_exporter.1.yyehqvcrodnw@swarm-master    | 2022/01/01 02:46:27 http: superfluous response.WriteHeader call from github.com/prometheus/client_golang/prometheus/promhttp.(*responseWriterDelegator).WriteHeader (delegator.go:65)
pihole_doh_pihole_exporter.1.yyehqvcrodnw@swarm-master    | Error unable to unmarshal PI-Hole statistics to statistics struct model: invalid character 'p' after top-level value
pihole_doh_pihole_exporter.1.yyehqvcrodnw@swarm-master    | 2022/01/01 02:46:42 http: superfluous response.WriteHeader call from github.com/prometheus/client_golang/prometheus/promhttp.(*responseWriterDelegator).WriteHeader (delegator.go:65)

Steps for Reproduction

  1. Set up the following "xxxx" value in the config.yaml configuration file
  2. Launch binary with the following arguments
  3. Step Two
  4. Step Three

Expected behavior:

cter 'p' after top-level value
pihole_doh_pihole_exporter.1.i53d9h4rrvku@swarm-master    | 2022/01/01 02:51:21 New tick of statistics: 0 ads blocked / 0 total DNS queries
pihole_doh_pihole_exporter.1.i53d9h4rrvku@swarm-master    | 2022/01/01 02:51:31 Unable to unmarshal PI-Hole statistics to statistics struct model invalid character 'p' after top-level value
pihole_doh_pihole_exporter.1.i53d9h4rrvku@swarm-master    | 2022/01/01 02:51:31 New tick of statistics: 0 ads blocked / 0 total DNS queries
pihole_doh_pihole_exporter.1.i53d9h4rrvku@swarm-master    | 2022/01/01 02:51:41 Unable to unmarshal PI-Hole statistics to statistics struct model invalid character 'p' after top-level value
pihole_doh_pihole_exporter.1.i53d9h4rrvku@swarm-master    | 2022/01/01 02:51:41 New tick of statistics: 0 ads blocked / 0 total DNS queries
pihole_doh_pihole_exporter.1.i53d9h4rrvku@swarm-master    | 2022/01/01 02:51:51 Unable to unmarshal PI-Hole statistics to statistics struct model invalid character 'p' after top-level value
pihole_doh_pihole_exporter.1.i53d9h4rrvku@swarm-master    | 2022/01/01 02:51:51 New tick of statistics: 0 ads blocked / 0 total DNS queries
pihole_doh_pihole_exporter.1.i53d9h4rrvku@swarm-master    | 2022/01/01 02:52:01 Unable to unmarshal PI-Hole statistics to statistics struct model invalid character 'p' after top-level value
pihole_doh_pihole_exporter.1.i53d9h4rrvku@swarm-master    | 2022/01/01 02:52:01 New tick of statistics: 0 ads blocked / 0 total DNS queries
pihole_doh_pihole_exporter.1.i53d9h4rrvku@swarm-master    | 2022/01/01 02:52:11 Unable to unmarshal PI-Hole statistics to statistics struct model invalid character 'p' after top-level value
pihole_doh_pihole_exporter.1.i53d9h4rrvku@swarm-master    | 2022/01/01 02:52:11 New tick of statistics: 0 ads blocked / 0 total DNS queries
pihole_doh_pihole_exporter.1.i53d9h4rrvku@swarm-master    | 2022/01/01 02:52:21 Unable to unmarshal PI-Hole statistics to statistics struct model invalid character 'p' after top-level value
pihole_doh_pihole_exporter.1.i53d9h4rrvku@swarm-master    | 2022/01/01 02:52:21 New tick of statistics: 0 ads blocked / 0 total DNS queries
pihole_doh_pihole_exporter.1.i53d9h4rrvku@swarm-master    | 2022/01/01 02:52:31 Unable to unmarshal PI-Hole statistics to statistics struct model invalid character 'p' after top-level value
pihole_doh_pihole_exporter.1.i53d9h4rrvku@swarm-master    | 2022/01/01 02:52:31 New tick of statistics: 0 ads blocked / 0 total DNS queries
pihole_doh_pihole_exporter.1.i53d9h4rrvku@swarm-master    | 2022/01/01 02:52:41 Unable to unmarshal PI-Hole statistics to statistics struct model invalid character 'p' after top-level value
pihole_doh_pihole_exporter.1.i53d9h4rrvku@swarm-master    | 2022/01/01 02:52:41 New tick of statistics: 0 ads blocked / 0 total DNS queries
pihole_doh_pihole_exporter.1.i53d9h4rrvku@swarm-master    | 2022/01/01 02:52:51 Unable to unmarshal PI-Hole statistics to statistics struct model invalid character 'p' after top-level value
pihole_doh_pihole_exporter.1.i53d9h4rrvku@swarm-master    | 2022/01/01 02:52:51 New tick of statistics: 0 ads blocked / 0 total DNS queries

Actual behavior:

Platforms:
amd64

Include browser, operating system and respective versions
Firefox , Linux Ubuntu Focal Fossa 20.04LTS

Versions:

Which versions are you running?

@raspberrycoulis
Copy link

I had this, I suspect you need to update the IP address of your Pi-Hole instance in the config to use the Docker network IP address. On my Pi-Hole instance, I have two IP addresses assigned to my Docker container - one for the external (i.e. 192.168.1.X) and one for the internal (i.e. 172.19.0.X) so that the container can talk to other containers on the internal network. I used the internal IP address on my config and it worked after.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants