1
1
mirror of https://gitlab.archlinux.org/archlinux/infrastructure.git synced 2025-01-18 08:06:16 +01:00
infrastructure/roles/prometheus_exporters/templates/prometheus-borg-textcollector.service.j2
Evangelos Foutras 68def695c8
Run borg-textcollector after each backup completes
Instead of gathering borg statistics every hour or so, run the text
collector script only once after each borg-backup service finishes.

Also split the borg text collector script into two similar scripts,
where each one gathers borg statistics for its respective borg host.
2021-07-18 06:16:32 +03:00

39 lines
837 B
Django/Jinja

[Unit]
Description=Prometheus {{ item.name|capitalize }} Exporter TextCollector
After=network.target
After={{ item.service }}.service
[Service]
Type=oneshot
ExecStart=/usr/local/bin/{{ item.name }}-textcollector.sh {{ prometheus_textfile_dir }}
NoNewPrivileges=true
LockPersonality=true
PrivateDevices=true
PrivateTmp=true
ProtectSystem=strict
ProtectHome=read-only
ReadWritePaths={{ prometheus_textfile_dir }} /root/.cache/borg
MemoryDenyWriteExecute=true
RemoveIPC=true
RestrictRealtime=true
RestrictNamespaces=true
RestrictSUIDSGID=true
RestrictAddressFamilies=~AF_PACKET
RestrictAddressFamilies=~AF_NETLINK
ProtectHostname=true
ProtectControlGroups=true
ProtectKernelLogs=true
ProtectKernelTunables=true
ProtectKernelModules=true
ProtectClock=true
SystemCallArchitectures=native
[Install]
WantedBy={{ item.service }}.service