summaryrefslogtreecommitdiff
path: root/roles/monitoring/prometheus/exporter/mikrotik/templates
diff options
context:
space:
mode:
authorChristian Pointner <equinox@spreadspace.org>2021-07-30 01:55:52 +0200
committerChristian Pointner <equinox@spreadspace.org>2021-07-30 01:55:52 +0200
commitaa7490a9a440b4518f79318be773b7da34e93c93 (patch)
tree486ba36d2653705fed4540f088b1b61f4bd3b821 /roles/monitoring/prometheus/exporter/mikrotik/templates
parentsome more preps for e21 (diff)
prometheus: add mikrotik exporter
Diffstat (limited to 'roles/monitoring/prometheus/exporter/mikrotik/templates')
-rw-r--r--roles/monitoring/prometheus/exporter/mikrotik/templates/config.yml.j27
-rw-r--r--roles/monitoring/prometheus/exporter/mikrotik/templates/service.j230
2 files changed, 37 insertions, 0 deletions
diff --git a/roles/monitoring/prometheus/exporter/mikrotik/templates/config.yml.j2 b/roles/monitoring/prometheus/exporter/mikrotik/templates/config.yml.j2
new file mode 100644
index 00000000..a2dc1c71
--- /dev/null
+++ b/roles/monitoring/prometheus/exporter/mikrotik/templates/config.yml.j2
@@ -0,0 +1,7 @@
+# {{ ansible_managed }}
+
+devices:
+ {{ prometheus_exporter_mikrotik_devices | to_nice_yaml(indent=2) | indent(2)}}
+
+features:
+ {{ prometheus_exporter_mikrotik_features | to_nice_yaml(indent=2) | indent(2)}}
diff --git a/roles/monitoring/prometheus/exporter/mikrotik/templates/service.j2 b/roles/monitoring/prometheus/exporter/mikrotik/templates/service.j2
new file mode 100644
index 00000000..a1c90455
--- /dev/null
+++ b/roles/monitoring/prometheus/exporter/mikrotik/templates/service.j2
@@ -0,0 +1,30 @@
+[Unit]
+Description=Prometheus mikrotik exporter
+
+[Service]
+Restart=always
+User=prometheus-exporter
+ExecStart=/usr/bin/prometheus-mikrotik-exporter -port "127.0.0.1:9436" -config-file /etc/prometheus/exporter/mikrotik/config.yml
+
+# systemd hardening-options
+AmbientCapabilities=
+CapabilityBoundingSet=
+DeviceAllow=/dev/null rw
+DevicePolicy=strict
+LockPersonality=true
+MemoryDenyWriteExecute=true
+NoNewPrivileges=true
+PrivateDevices=true
+PrivateTmp=true
+ProtectControlGroups=true
+ProtectHome=true
+ProtectKernelModules=true
+ProtectKernelTunables=true
+ProtectSystem=strict
+RemoveIPC=true
+RestrictNamespaces=true
+RestrictRealtime=true
+SystemCallArchitectures=native
+
+[Install]
+WantedBy=multi-user.target