Added service

This commit is contained in:
Justine 2022-07-03 17:08:23 +02:00
parent f0553866f8
commit add3ce7dff
2 changed files with 24 additions and 3 deletions

View File

@ -14,8 +14,18 @@ template:
It gives knot's default stats, plus the rrl stats. For other modules, you'll have to add them yourself; have a look at the get_stats and gen_metrics functions.
# Prometheus job example
The exporter uses port 8001.
```yaml
- job_name: 'knot-stats'
static_configs:
- targtes: ['myknot:8001']
```
# Installation
I don't know yet; might create a .deb
* Copy knot-prom.py to /usr/bin and make it executable by root
* Copy prometheus-knot-exporter.service to /etc/systemd/system
* systemctl enable prometheus-knot-exporter.service && systemctl start prometheus-knot-exporter.service
* Don't forget to open port 8001/tcp in your firewall

View File

@ -0,0 +1,11 @@
[Unit]
Description=prometheus-knot-exporter
[Service]
User=root
ExecStart=/usr/bin/knot-prom.py
Restart=on-failure
[Install]
WantedBy=multi-user.target