optix2000 / nsd_exporter

Prometheus exporter for NSD (Name Server Daemon)
BSD 3-Clause "New" or "Revised" License
8 stars 8 forks source link

Support Unix Domain Sockets for NSD #11

Open optix2000 opened 3 years ago

optix2000 commented 3 years ago

Will need a change in optix2000/go-nsdctl

james-stevens commented 1 year ago

I could use an nsd exporter that works with unix sockets too

You might want to take a look at https://github.com/letsencrypt/unbound_exporter or https://github.com/Jean-Daniel/dns_exporter which are both in Go and the unbound one def has unix socket support

When I try to use a tcp socket & auto-config from conf file I just get

2023/08/14 16:54:25 dial tcp: address tcp/⋸: unknown port

and I have no idea where to go from there

optix2000 commented 1 year ago

@james-stevens I'm no longer using nsd at work. Do you have an example config that uses a socket connection?

james-stevens commented 1 year ago

In my nsd.conf I have the following

remote-control:
    control-interface: /run/nsd.control.sock

I beleive that's all you need, and you can have both the TCP & unix sockets enabled at the same time.

I also have

    control-interface: 127.0.0.1
    control-port: 8952

Obv, if you are running the exporter locally, using the unix socket makes life easier & more secure.