Pihole collector not working

Problem/Question

Pihole plugin states unauthorized access

Relevant docs you followed/actions you took to solve the issue

Environment/Browser/Agent’s version etc

netdata v1.37.0-89-nightly
Pihole in Docker running under network_mode: "host"

Config:

jobs:
  - name: pihole
    # url: http://127.0.0.1
    setup_vars_path: /home/modem7/DockerApps/Pihole/etc/pihole/setupVars.conf

Logs:

[ DEBUG ] main[main] main.go:113 plugin: name=go.d, version=v0.47.0
[ DEBUG ] main[main] main.go:115 current user: name=netdata, uid=115
[ INFO  ] main[main] agent.go:136 instance is started
[ INFO  ] main[main] setup.go:42 loading config file
[ INFO  ] main[main] setup.go:50 looking for 'go.d.conf' in [/etc/netdata /usr/lib/netdata/conf.d]
[ INFO  ] main[main] setup.go:57 found '/usr/lib/netdata/conf.d/go.d.conf
[ INFO  ] main[main] setup.go:64 config successfully loaded
[ INFO  ] main[main] agent.go:140 using config: enabled 'true', default_run 'true', max_procs '0'
[ INFO  ] main[main] setup.go:69 loading modules
[ INFO  ] main[main] setup.go:88 enabled/registered modules: 1/78
[ INFO  ] main[main] setup.go:93 building discovery config
[ INFO  ] main[main] setup.go:123 looking for 'pihole.conf' in [/etc/netdata/go.d /usr/lib/netdata/conf.d/go.d]
[ INFO  ] main[main] setup.go:139 found '/etc/netdata/go.d/pihole.conf
[ INFO  ] main[main] setup.go:144 dummy/read/watch paths: 0/1/0
[ INFO  ] discovery[manager] manager.go:92 registered discoverers: [file discovery: [file reader]]
[ INFO  ] discovery[manager] manager.go:97 instance is started
[ INFO  ] run[manager] run.go:32 instance is started
[ INFO  ] build[manager] build.go:107 instance is started
[ INFO  ] discovery[file manager] discovery.go:73 instance is started
[ INFO  ] discovery[file reader] read.go:41 instance is started
[ INFO  ] discovery[file reader] read.go:42 instance is stopped
[ DEBUG ] build[manager] build.go:154 received config group ('/etc/netdata/go.d/pihole.conf'): 1 jobs (added: 1, removed: 0)
[ DEBUG ] build[manager] build.go:303 building pihole[pihole] job, config: map[__provider__:file reader __source__:/etc/netdata/go.d/pihole.conf autodetection_retry:0 module:pihole name:pihole not_follow_redirects:false priority:70000 setup_vars_path:/home/modem7/DockerApps/Pihole/etc/pihole/setupVars.conf update_every:5]
[ INFO  ] pihole[pihole] init.go:37 starting web password auto detection, reading : /home/modem7/DockerApps/Pihole/etc/pihole/setupVars.conf
[ DEBUG ] pihole[pihole] pihole.go:77 web password: <password>
[ ERROR ] pihole[pihole] collect.go:152 unauthorized access to http://127.0.0.1/admin/api.php?summaryRaw=true
[ INFO  ] pihole[pihole] job.go:194 check success
[ INFO  ] pihole[pihole] job.go:214 started, data collection interval 5s
[ DEBUG ] run[manager] run.go:43 tick 0
[ ERROR ] pihole[pihole] collect.go:152 unauthorized access to http://127.0.0.1/admin/api.php?summaryRaw=true
CHART 'netdata.execution_time_of_pihole' '' 'Execution time' 'ms' 'go.d' 'netdata.go_plugin_execution_time' 'line' '145000' '5' '' 'go.d' 'pihole'
CLABEL '_collect_job' 'pihole' '1'
CLABEL_COMMIT
DIMENSION 'time' '' 'absolute' '1' '1' ''

CHART 'pihole.dns_queries_total' '' 'DNS Queries Total (Cached, Blocked and Forwarded)' 'queries' 'queries' 'pihole.dns_queries_total' 'line' '70000' '5' '' 'go.d' 'pihole'
CLABEL '_collect_job' 'pihole' '1'
CLABEL_COMMIT
DIMENSION 'queries' 'queries' 'absolute' '1' '1' ''

BEGIN 'pihole.dns_queries_total'
SET 'queries' =
END

CHART 'pihole.dns_queries' '' 'DNS Queries' 'queries' 'queries' 'pihole.dns_queries' 'stacked' '70001' '5' '' 'go.d' 'pihole'
CLABEL '_collect_job' 'pihole' '1'
CLABEL_COMMIT
DIMENSION 'cached' 'cached' 'absolute' '1' '1' ''
DIMENSION 'blocked' 'blocked' 'absolute' '1' '1' ''
DIMENSION 'forwarded' 'forwarded' 'absolute' '1' '1' ''

BEGIN 'pihole.dns_queries'
SET 'cached' =
SET 'blocked' =
SET 'forwarded' =
END

CHART 'pihole.dns_queries_percentage' '' 'DNS Queries Percentage' 'percentage' 'queries' 'pihole.dns_queries_percentage' 'stacked' '70002' '5' '' 'go.d' 'pihole'
CLABEL '_collect_job' 'pihole' '1'
CLABEL_COMMIT
DIMENSION 'cached' 'cached' 'absolute' '1' '1000' ''
DIMENSION 'blocked' 'blocked' 'absolute' '1' '1000' ''
DIMENSION 'forwarded' 'forwarded' 'absolute' '1' '1000' ''

BEGIN 'pihole.dns_queries_percentage'
SET 'cached' =
SET 'blocked' =
SET 'forwarded' =
END

CHART 'pihole.unique_clients' '' 'Unique Clients' 'clients' 'clients' 'pihole.unique_clients' 'line' '70003' '5' '' 'go.d' 'pihole'
CLABEL '_collect_job' 'pihole' '1'
CLABEL_COMMIT
DIMENSION 'unique' 'unique' 'absolute' '1' '1' ''

BEGIN 'pihole.unique_clients'
SET 'unique' =
END

CHART 'pihole.domains_on_blocklist' '' 'Domains On Blocklist' 'domains' 'blocklist' 'pihole.domains_on_blocklist' 'line' '70004' '5' '' 'go.d' 'pihole'
CLABEL '_collect_job' 'pihole' '1'
CLABEL_COMMIT
DIMENSION 'blocklist' 'blocklist' 'absolute' '1' '1' ''

BEGIN 'pihole.domains_on_blocklist'
SET 'blocklist' =
END

CHART 'pihole.blocklist_last_update' '' 'Blocklist Last Update' 'seconds' 'blocklist' 'pihole.blocklist_last_update' 'line' '70005' '5' '' 'go.d' 'pihole'
CLABEL '_collect_job' 'pihole' '1'
CLABEL_COMMIT
DIMENSION 'ago' 'ago' 'absolute' '1' '1' ''

BEGIN 'pihole.blocklist_last_update'
SET 'ago' =
END

CHART 'pihole.unwanted_domains_blocking_status' '' 'Unwanted Domains Blocking Status' 'status' 'status' 'pihole.unwanted_domains_blocking_status' 'line' '70006' '5' '' 'go.d' 'pihole'
CLABEL '_collect_job' 'pihole' '1'
CLABEL_COMMIT
DIMENSION 'enabled' 'enabled' 'absolute' '1' '1' ''
DIMENSION 'disabled' 'disabled' 'absolute' '1' '1' ''

BEGIN 'pihole.unwanted_domains_blocking_status'
SET 'enabled' =
SET 'disabled' =
END

CHART 'pihole.dns_queries_types' '' 'DNS Queries Per Type' 'percentage' 'doQuery types' 'pihole.dns_queries_types' 'stacked' '70007' '5' '' 'go.d' 'pihole'
CLABEL '_collect_job' 'pihole' '1'
CLABEL_COMMIT
DIMENSION 'A' '' 'absolute' '1' '100' ''
DIMENSION 'AAAA' '' 'absolute' '1' '100' ''
DIMENSION 'ANY' '' 'absolute' '1' '100' ''
DIMENSION 'PTR' '' 'absolute' '1' '100' ''
DIMENSION 'SOA' '' 'absolute' '1' '100' ''
DIMENSION 'SRV' '' 'absolute' '1' '100' ''
DIMENSION 'TXT' '' 'absolute' '1' '100' ''

BEGIN 'pihole.dns_queries_types'
SET 'A' = 4052
SET 'AAAA' = 3479
SET 'ANY' = 0
SET 'PTR' = 2452
SET 'SOA' = 0
SET 'SRV' = 3
SET 'TXT' = 1
END

CHART 'pihole.dns_queries_forwarded_destination' '' 'DNS Queries Per Destination' 'percentage' 'queries answered by' 'pihole.dns_queries_forwarded_destination' 'stacked' '70008' '5' '' 'go.d' 'pihole'
CLABEL '_collect_job' 'pihole' '1'
CLABEL_COMMIT
DIMENSION 'cached' 'cached' 'absolute' '1' '100' ''
DIMENSION 'blocked' 'blocked' 'absolute' '1' '100' ''
DIMENSION 'other' 'other' 'absolute' '1' '100' ''

BEGIN 'pihole.dns_queries_forwarded_destination'
SET 'cached' = 2716
SET 'blocked' = 12
SET 'other' = 2
END

BEGIN 'netdata.execution_time_of_pihole'
SET 'time' = 6
END

[ DEBUG ] run[manager] run.go:43 tick 1
[ DEBUG ] run[manager] run.go:43 tick 2
[ DEBUG ] run[manager] run.go:43 tick 3

This issue has been reported and fixed.

1 Like

Updates on the fix [Bug]: Pi-hole stats fail to be collected · Issue #14183 · netdata/netdata · GitHub