-
Notifications
You must be signed in to change notification settings - Fork 2
/
hologram-monitoring-agents.pkg.toml
99 lines (86 loc) · 2.75 KB
/
hologram-monitoring-agents.pkg.toml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
[package]
name = "hologram-monitoring-agents"
version = "0.2.3"
description = "hologram: monitoring agents"
requires = [
"prometheus-minimum-viable-sd",
"prometheus-node-exporter",
"secrets", # this uses /usr/bin/replicator
]
# allow Prometheus access to exporters via private network
[[file]]
path = "/etc/ferm.d/incoming-exporters"
content = "proto tcp dport 9100 interface wg-monitoring ACCEPT;"
[[symlink]]
path = "/usr/share/holo/files/20-monitoring-server/etc/ferm.d/incoming-exporters.holoscript"
target = "/usr/bin/replicator"
################################################################################
# node exporter
[[symlink]]
path = "/etc/systemd/system/multi-user.target.wants/prometheus-node-exporter.service"
target = "/usr/lib/systemd/system/prometheus-node-exporter.service"
[[file]]
path = "/etc/systemd/system/prometheus-node-exporter.service.d/hardening.conf"
content = '''
[Service]
User=nobody
Group=nobody
'''
[[file]]
path = "/usr/share/holo/files/20-monitoring-agents/etc/conf.d/prometheus-node-exporter"
content = 'NODE_EXPORTER_ARGS="--no-collector.wifi"'
################################################################################
# prometheus-minimum-viable-sd announce
[[file]]
path = "/etc/prometheus/services.json"
content = '''
[
{
"targets": [ "{{.Vars.prometheus.slash24}}.{{.Vars.host.id}}:9100" ],
"labels": {
"instance": "{{.Vars.host.name}}",
"job": "prometheus-node-exporter"
}
}
]
'''
[[symlink]]
path = "/usr/share/holo/files/20-monitoring-agents/etc/prometheus/services.json.holoscript"
target = "/usr/bin/replicator"
[[file]]
path = "/usr/lib/systemd/system/prometheus-minimum-viable-sd.service"
content = '''
[Unit]
Description=Minimum Viable service discovery for Prometheus
[Service]
DynamicUser=yes
ExecStart=/usr/bin/prometheus-minimum-viable-sd announce /etc/prometheus/services.json {{.Vars.prometheus.sd_address}}
LockPersonality=yes
MemoryDenyWriteExecute=yes
NoNewPrivileges=yes
PrivateDevices=yes
PrivateTmp=yes
ProtectControlGroups=yes
ProtectHome=yes
ProtectHostname=yes
ProtectKernelModules=yes
ProtectKernelTunables=yes
ProtectSystem=strict
Restart=always
RestartSec=10s
RestrictAddressFamilies=AF_INET AF_INET6
RestrictNamespaces=yes
RestrictRealtime=yes
RestrictSUIDSGID=yes
SystemCallArchitectures=native
SystemCallErrorNumber=EPERM
SystemCallFilter=@system-service
[Install]
WantedBy=multi-user.target
'''
[[symlink]]
path = "/usr/share/holo/files/20-monitoring-agents/usr/lib/systemd/system/prometheus-minimum-viable-sd.service.holoscript"
target = "/usr/bin/replicator"
[[symlink]]
path = "/etc/systemd/system/multi-user.target.wants/prometheus-minimum-viable-sd.service"
target = "/usr/lib/systemd/system/prometheus-minimum-viable-sd.service"