PiHole collector: "abort web password auto detection, host is not localhost"

Not sure what I’m missing here, I don’t see an option to specify web password in the list of job parameters for the pihole collector, there’s just a path for setupVars.conf where it’s supposed to autodetect the password.

My go.d/pihole.conf:

jobs:
  - name: pihole
    url: http://172.69.0.53
    setup_vars_path: /etc/pihole/setupVars.conf

/etc/pihole/setupVars.conf is a volume in my Docker config as I’m running both PiHole and Netdata as docker containers on the same bridge network.

Here is the output from ./go.d.plugin -d -m pihole:

[ DEBUG ] build[manager] build.go:164 received config group ('/etc/netdata/go.d/pihole.conf'): 1 jobs (added: 1, removed: 0)
[ DEBUG ] build[manager] build.go:313 building pihole[pihole] job, config: map[__provider__:file reader __source__:/etc/netdata/go.d/pihole.conf autodetection_retry:0 module:pihole name:pihole priority:70000 setup_vars_path:/etc/pihole/setupVars.conf update_every:5 url:http://172.69.0.53]
[ INFO  ] pihole[pihole] init.go:33 abort web password auto detection, host is not localhost
[ WARN  ] pihole[pihole] pihole.go:75 no web password, not all metrics available
[ ERROR ] pihole[pihole] collect.go:148 unauthorized access to http://172.69.0.53/admin/api.php?auth=&summaryRaw=true
[ ERROR ] pihole[pihole] job.go:205 check failed

Am I simply missing some docs that say there’s a webpassword option in the config? :pray:t2:

Worked out my own problem seconds later, all it took was my forum post to think of a new thing…

I saw a hint on this page:
https://pi-hole.net/blog/2022/11/17/upcoming-changes-authentication-for-more-api-endpoints-required/#page-content

The password netdata is expecting in the password field is the token from setupVars.conf and not the actual password.

jobs:
  - name: pihole
    url: http://172.69.0.53
    setup_vars_path: /etc/pihole/setupVars.conf
    password: <WEBPASSWORD from setupVars.conf>
1 Like

Hi, @Callumpy. You are correct, I see there is logic to skip reading setupVars if not localhost.

You can set the password using password config topion.

Ah wish I’d searched in Github, there’s a hint in there too!

if strings.HasPrefix(s.Text(), "WEBPASSWORD")

Thanks for your prompt reply!