From aa7490a9a440b4518f79318be773b7da34e93c93 Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Fri, 30 Jul 2021 01:55:52 +0200 Subject: prometheus: add mikrotik exporter --- .../exporter/mikrotik/templates/config.yml.j2 | 7 +++++ .../exporter/mikrotik/templates/service.j2 | 30 ++++++++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 roles/monitoring/prometheus/exporter/mikrotik/templates/config.yml.j2 create mode 100644 roles/monitoring/prometheus/exporter/mikrotik/templates/service.j2 (limited to 'roles/monitoring/prometheus/exporter/mikrotik/templates') 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 -- cgit v1.2.3