From add3ce7dff8bc5d00e56da7dac827e5ecd2ed788 Mon Sep 17 00:00:00 2001 From: Justine Date: Sun, 3 Jul 2022 17:08:23 +0200 Subject: [PATCH] Added service --- README.md | 16 +++++++++++++--- prometheus-knot-exporter.service | 11 +++++++++++ 2 files changed, 24 insertions(+), 3 deletions(-) create mode 100644 prometheus-knot-exporter.service diff --git a/README.md b/README.md index 09ce044..3950ef8 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/prometheus-knot-exporter.service b/prometheus-knot-exporter.service new file mode 100644 index 0000000..2288265 --- /dev/null +++ b/prometheus-knot-exporter.service @@ -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 +