fast-exporter: export fastd statistics

This commit is contained in:
Markus 2018-07-26 11:08:03 +02:00
parent f40a674a0d
commit bc1fadd083
6 changed files with 50 additions and 0 deletions

View File

@ -0,0 +1,4 @@
---
fastd_instances: 3
fastd_exporter_source: "github.com/freifunk-darmstadt/fastd-exporter"

View File

@ -0,0 +1,12 @@
[Unit]
Description=fastd Exporter
[Service]
Type=simple
User=fastd-exporter
Environment=PATH=/usr/bin:/usr/local/bin
EnvironmentFile=/etc/default/fastd-exporter
ExecStart=/opt/go/bin/fastd-exporter $OPTIONS
[Install]
WantedBy=multi-user.target

View File

@ -0,0 +1,7 @@
---
- name: Restart fastd-exporter
service: name=fastd-exporter state=restarted
- name: Reload systemd
command: systemctl daemon-reload

View File

@ -0,0 +1,25 @@
---
- name: Create user
user: name=fastd-exporter
- name: Install fastd-exporter
shell: /usr/local/go/bin/go get -v -u {{ fastd_exporter_source }}
args:
creates: /opt/go/bin/fastd-exporter
environment:
GOPATH: /opt/go
notify: Restart fastd-exporter
- name: Configure fastd-exporter
template: src=fastd-exporter.j2 dest=/etc/default/fastd-exporter
notify: Restart fastd-exporter
- name: Install systemd unit
copy: src=fastd-exporter.service dest=/lib/systemd/system/fastd-exporter.service
notify:
- Reload systemd
- Restart fastd-exporter
- name: Enable fastd-exporter
service: name=fastd-exporter state=started enabled=yes

View File

@ -0,0 +1 @@
OPTIONS="-metrics.perpeer -instances {{ site_code }}{{ range(fastd_instances)|join(',' + site_code) }}"

View File

@ -16,6 +16,7 @@
- batman
- bird
- fastd
- fastd-exporter
- mesh-interfaces
- exit-ip
- dns