bind_exporter icon indicating copy to clipboard operation
bind_exporter copied to clipboard

Couldn't retrieve BIND stats connection refused

Open armaneth95 opened this issue 3 years ago • 1 comments

Hi Am new to prometheus and giving it a try. I've installed bind_exporter v0.4.0 on a Centos 7 machine running bind 9.11.4. I noticed on the Grafana dashboard that some metrics have no data to show. When i checked my logs i get the following message:

localhost prometheus: level=error ts=2021-10-19T17:33:40.624Z caller=bind_exporter.go:427 msg="Couldn't retrieve BIND stats" err="error querying stats: Get \"http://localhost:8053/\": dial tcp [::1]:8053: connect: connection refused"

I've tried curl http://localhost:8053/.The result is curl: (7) Failed connect to localhost:8053; Connection refused

Currently, firewalld is stopped. Below is the content of bind exporter service file (/etc/systemd/system/bind_exporter)

[Unit]
Description=Prometheus
Documentation=https://github.com/prometheus-community/bind_exporter
Wants=network-online.target
After=network-online.target

[Service]
Type=simple
User=prometheus
Group=prometheus
ExecReload=/bin/kill -HUP $MAINPID
ExecStart=/usr/local/bin/bind_exporter \
  --bind.pid-file=/run/named/named.pid \
  --bind.timeout=10s \
  --web.listen-address=0.0.0.0:9153 \
  --web.telemetry-path=/metrics \
  --bind.stats-url=http://localhost:8053/ \
  --bind.stats-groups=server,view,tasks

SyslogIdentifier=prometheus
Restart=always

[Install]
WantedBy=multi-user.target

I added the following lines to /etc/named.conf and restarted bindsuccessfully before starting bind_exporter

statistics-channels {
  inet 127.0.0.1 port 8053 allow { 127.0.0.1; };
};

Any help to find out what I did wrong will be helpful. Thanks in advance for your help

armaneth95 avatar Oct 19 '21 18:10 armaneth95

similar of ? https://github.com/prometheus-community/bind_exporter/issues/118 which Bind Version do you use ? Pull the last Release and check again in my case this is fixed by this release

DoM1niC avatar Nov 24 '21 14:11 DoM1niC

Your localhost resolves to IPv6, but you are only listening on IPv4. Either change your bind.stats-url to use the IPv4 address, or add ::1 to your statistics-channels config.

SuperQ avatar Nov 16 '22 11:11 SuperQ