mirror of
https://gitlab.archlinux.org/archlinux/infrastructure.git
synced 2025-01-18 08:06:16 +01:00
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.
39 lines
837 B
Django/Jinja
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
|