caarlos0 / domain_exporter

Exports the expiration time of your domains as prometheus metrics.
MIT License
265 stars 54 forks source link

Problem installing, not listening on port 9222 #275

Closed jvb0077 closed 5 months ago

jvb0077 commented 5 months ago

Hi guys, I have a problem installing domain_exporter. I did install it using apt-get, and I see the package installed. I also added the job in my prometheus.yml. However, I see nothing is listening on port 9222. Also, the target is down in Prometheus. with connection refused. I also can't reach anything via the browser on port 9222. Am I missing something here, or did I make a mistake?

caarlos0 commented 5 months ago

did you start the service? I'm not sure if the package you installed come with a systemd unit by default... but if it does, you probably need to enable/start it.

if it doesn't, you need to create the service manually or run the binary directly

jvb0077 commented 5 months ago

Thanks, got it to work by creating a service. Seemed pretty straight forward to me a package comes with a service, but maybe it isn't in Linux world. Anyway, thx!

tshrinivasan commented 3 months ago

@jvb0077 Please share the systemd service file here. it will be very useful.

Thanks for the nice work @caarlos0

tshrinivasan commented 3 months ago

cat /etc/systemd/system/domain-exporter.service

[Unit]
Description=domain-exporter
After=network.target
StartLimitIntervalSec=0

[Service]
Type=simple
Restart=always
RestartSec=1
User=root
ExecStart=/usr/bin/domain_exporter 

[Install]
WantedBy=multi-user.target

Here is the systemd file for domain_exporter