Closed stefangweichinger closed 1 year ago
Checking things further:
docker exec -it prometheus-prometheus-1 sh
telnet host.docker.internal 9211
telnet: can't connect to remote host (172.17.0.1): Connection refused
Interesting ...
I use the same hostname for mysqld-exporter, that one works:
telnet host.docker.internal 9104
Connected to host.docker.internal
So it might be related to dnsbl_exporter
and maybe its service-file.
I forgot, is there a telnet -v
to see what it does?
Otherwise, maybe: nc -zv host.docker.internal 9211
? Also, not entirely sure if host.docker.internal
in your setup includes the loop back interface?
Can you curl http://0.0.0.0:9211/metrics
from the host? To make sure it listens on all expected interfaces.
There is no telnet -v
, sorry.
And nc
returns nothing:
/prometheus $ nc -zv host.docker.internal 9211
/prometheus $
The curl works from the host, yes:
curl http://0.0.0.0:9211/metrics
# HELP luzilla_rbls_duration The scrape's duration (in seconds)
# TYPE luzilla_rbls_duration gauge
luzilla_rbls_duration 0.147485518
# HELP luzilla_rbls_ips_blacklisted Blacklisted IPs
# TYPE luzilla_rbls_ips_blacklisted gauge
luzilla_rbls_ips_blacklisted{hostname="imap.my.tld",ip="185.xxxx",rbl="ix.dnsbl.manitu.net"} 0
I tested with binding dnsbl_exporter to "0.0.0.0:9211" or "127.0.0.1:9211" on the host, no difference.
Checked the docker networks, FQDN host.docker.internal is reachable from the prometheus container as seen above (the mysqld_exporter can be scraped from host AND prometheus container).
Interesting issue somehow ...
You verified the binding? E.g. lsof -i
? I can't think of a reason why it wouldn't work.
Can you share which Linux, Docker, etc. you run? This seems like an interesting problem.
Yes, I verfied the binding with ss -lnp | grep 9211
(not the most competent use, I assume ;-) )
lsof -i | grep 9211
dnsbl-exp 3203757 root 3u IPv6 28037996 0t0 TCP *:9211 (LISTEN)
It's not that urgent on my side and I am quite busy this week. I'll get back to it asap.
This is running on docker 20.10.24+dfsg1 (Debian 12.1). Maybe it's some strange iptables-issue and magically solved by a reboot.
I have a second mailserver where I will also try to set up your exporter etc. Then we will see if it works there (and maybe, why).
Solved: iptables rule was missing! What a shame ... took me quite a long time. Now I get metrics into prometheus and can proceed. Thanks, closing here.
systemd service
Downloaded current binary into:
Set up service file as in https://github.com/Luzilla/dnsbl_exporter/issues/86#issue-860439522
modified paths to ini-files etc ->
Service runs, and returns metrics:
prometheus
Prometheus runs in docker, so I have to enable it to access ports on the host level. This is done by setting "extra_hosts":
The scraping is configured in
prometheus.yml
:No errors are shown, but I don't see any metrics with "luzilla*" in Grafana/Prometheus.