-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(unbound): unbound-exporter installation
- Loading branch information
Showing
2 changed files
with
57 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
54 changes: 54 additions & 0 deletions
54
Applications/PiHole/install-unbound-prometheus-exporter.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
# Install the Unbound Prometheus Exporter | ||
|
||
## Install | ||
|
||
### Install golang & compile the exporter | ||
|
||
```bash | ||
sudo apt update -y | ||
sudo apt install golang | ||
``` | ||
|
||
Clone, compile & move the exporter to the correct location | ||
|
||
```bash | ||
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 | ||
|
||
```bash | ||
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 | ||
|
||
```bash | ||
sudo systemctl daemon-reload | ||
sudo systemctl enable --now unbound-exporter.service | ||
``` | ||
|
||
### Test the exporter | ||
|
||
```bash | ||
curl localhost:9167/metrics | ||
``` |