Install the Unbound Prometheus Exporter⚑
Install⚑
Install golang & compile the exporter⚑
sudo apt update -y
sudo apt install golang
Clone, compile & move the exporter to the correct location
git clone https://github.com/letsencrypt/unbound_exporter.git
cd unbound_exporter
go build
sudo install -o root -g root -m 0755 unbound_exporter /usr/local/bin/unbound-exporter
cd ..
rm -rf unbound_exporter
Create a systemd service⚑
cat << EOF > /etc/systemd/system/unbound-exporter.service
[Unit]
Description=Unbound Prometheus Exporter
After=network.target
[Service]
Type=simple
User=root
Group=root
Restart=always
ExecStart=/usr/local/bin/unbound-exporter -web.listen-address ":9167" -web.telemetry-path "/metrics"
[Install]
WantedBy=multi-user.target
EOF
Start the service⚑
sudo systemctl daemon-reload
sudo systemctl enable --now unbound-exporter.service
Test the exporter⚑
curl localhost:9167/metrics