summaryrefslogtreecommitdiff
path: root/roles/monitoring/prometheus/exporter/node/templates/textfile-collector-scripts/smartmon.service.j2
diff options
context:
space:
mode:
authorChristian Pointner <equinox@spreadspace.org>2021-09-24 15:05:48 +0200
committerChristian Pointner <equinox@spreadspace.org>2021-09-24 15:05:48 +0200
commit9a47d5c3ef94cb09338a1b64d4dc9365d526bb54 (patch)
tree86164b8dc69beb65a1e60ca70c4f52a08548b5e7 /roles/monitoring/prometheus/exporter/node/templates/textfile-collector-scripts/smartmon.service.j2
parentfix some todos (diff)
refactor textfile collector script handling
Diffstat (limited to 'roles/monitoring/prometheus/exporter/node/templates/textfile-collector-scripts/smartmon.service.j2')
-rw-r--r--roles/monitoring/prometheus/exporter/node/templates/textfile-collector-scripts/smartmon.service.j229
1 files changed, 29 insertions, 0 deletions
diff --git a/roles/monitoring/prometheus/exporter/node/templates/textfile-collector-scripts/smartmon.service.j2 b/roles/monitoring/prometheus/exporter/node/templates/textfile-collector-scripts/smartmon.service.j2
new file mode 100644
index 00000000..fc7c9f3f
--- /dev/null
+++ b/roles/monitoring/prometheus/exporter/node/templates/textfile-collector-scripts/smartmon.service.j2
@@ -0,0 +1,29 @@
+[Unit]
+Description=Promethues node exporter textfile collector smartmon
+
+[Service]
+Type=oneshot
+Environment=TMPDIR=/var/lib/prometheus-node-exporter/textfile-collector
+Environment=LC_NUMERIC=C
+ExecStart=bash -c "/usr/local/share/prometheus-node-exporter/smartmon | sponge /var/lib/prometheus-node-exporter/textfile-collector/smartmon.prom"
+
+# systemd hardening-options
+AmbientCapabilities=
+CapabilityBoundingSet=
+LockPersonality=true
+MemoryDenyWriteExecute=true
+NoNewPrivileges=true
+PrivateTmp=true
+ProtectControlGroups=true
+ProtectHome=true
+ProtectKernelModules=true
+ProtectKernelTunables=true
+ProtectSystem=strict
+ReadWritePaths=/var/lib/prometheus-node-exporter/textfile-collector
+RemoveIPC=true
+RestrictNamespaces=true
+RestrictRealtime=true
+SystemCallArchitectures=native
+
+[Install]
+WantedBy=multi-user.target