bind_exporter
bind_exporter copied to clipboard
Couldn't retrieve BIND stats connection refused
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
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
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.