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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
|
metrics: true
ui:
title: "liz.coffee health dashboard."
header: "liz.coffee"
description: "⋆⭒˚.⋆ 🐧 <3 ⋆⭒˚.⋆"
logo: "https://src.liz.coffee/cgit.png"
default-sort-by: "group"
alerting:
ntfy:
topic: "{{ ntfy_topic }}"
priority: 3
endpoints:
- name: "HealthCheck"
url: "{{ healthchecks_io_ping }}"
interval: 60s
conditions:
- "[STATUS] == 200"
- "[BODY] == pat(*OK*)"
alerts:
- type: ntfy
failure-threshold: 3
send-on-resolved: true
description: "GlobalHealthCheck"
- name: "LDAPS"
url: "tls://{{ idm_domain }}:3636"
interval: 2m
client:
timeout: 5s
conditions:
- "[CONNECTED] == true"
- "[CERTIFICATE_EXPIRATION] > 48h"
alerts:
- type: ntfy
failure-threshold: 3
send-on-resolved: true
description: "LDAPS"
- name: "ssh for git"
url: "tls://src.{{ domain }}:2222"
interval: 2m
client:
timeout: 5s
conditions:
- "[CONNECTED] == true"
- "[CERTIFICATE_EXPIRATION] > 48h"
alerts:
- type: ntfy
failure-threshold: 3
send-on-resolved: true
description: "ssh for git"
{% for test in email_tests %}
{% set from_account = (email_accounts | selectattr("email", "equalto", test.from) | list).0 %}
{% set to_account = (email_accounts | selectattr("email", "equalto", test.to) | list).0 %}
- name: "{{ test.name }}"
url: "http://uptime:9000/email"
method: "POST"
interval: 15m
client:
timeout: 120s
group: "mail"
body: |
{
"from": {
"email": "{{ from_account.email }}",
"username": "{{ from_account.username }}",
"password": "{{ from_account.password }}",
"send_host": "{{ from_account.host }}",
"send_port": 465
},
"to": {
"email": "{{ to_account.email }}",
"username": "{{ to_account.username }}",
"password": "{{ to_account.password }}",
"read_host": "{{ to_account.host }}",
"read_port": 993
},
"readRetry": {
"interval": 5,
"attempts": 24
}
}
conditions:
- "[STATUS] == 200"
- "[BODY] == pat(*ok*)"
alerts:
- type: ntfy
failure-threshold: 3
send-on-resolved: true
description: "mail {{ test.name }}"
{% endfor %}
{% for port in [465,993] %}
- name: "mail on port {{ port }}"
group: "mail"
url: "tls://{{ mail_domain }}:{{ port }}"
interval: 2m
client:
timeout: 5s
conditions:
- "[CONNECTED] == true"
- "[CERTIFICATE_EXPIRATION] > 48h"
alerts:
- type: ntfy
failure-threshold: 3
send-on-resolved: true
description: "mail on port {{ port }}"
{% endfor %}
{% for user, m in mesh.items() %}
{% for healthcheck in m.public_healthchecks %}
- name: "healthcheck {{ user }} pub {{ healthcheck }} 200"
group: "{{ user }}_pub"
url: "{{ healthcheck }}"
interval: 2m
conditions:
- "[STATUS] == 200"
- "[CERTIFICATE_EXPIRATION] > 240h"
alerts:
- type: ntfy
failure-threshold: 3
send-on-resolved: true
description: "healthcheck {{ user }} pub {{ healthcheck }} 200"
{% endfor %}
{% for healthcheck in m.private_healthchecks %}
- name: "{{ healthcheck }} priv healthcheck {{ user }}"
url: "{{ healthcheck }}"
client:
dns-resolver: "tcp://{{ m.gateway }}:53"
group: "{{ user }}_priv"
interval: 2m
conditions:
- "[STATUS] == 200"
- "[CERTIFICATE_EXPIRATION] > 240h"
alerts:
- type: ntfy
failure-threshold: 3
send-on-resolved: true
description: "{{ healthcheck }} priv healthcheck {{ user }}"
- name: "{{ healthcheck }} pub healthcheck {{ user }} 403"
group: "{{ user }}_priv"
url: "{{ healthcheck }}"
client:
dns-resolver: "tcp://{{ public_resolver }}:53"
interval: 2m
conditions:
- "[STATUS] == 403"
alerts:
- type: ntfy
failure-threshold: 3
send-on-resolved: true
description: "{{ healthcheck }} pub healthcheck {{ user }} 403"
{% endfor %}
{% for record in m.private_records %}
- name: "DNS Check [{{ record.name }}_{{ record.type }}]"
group: "{{ user }}_dns_private"
url: "{{ m.gateway }}"
interval: 2m
dns:
query-name: "{{ record.name }}"
query-type: "{{ record.type }}"
conditions:
- "[BODY] == {{ record.ip }}"
- "[DNS_RCODE] == NOERROR"
alerts:
- type: ntfy
failure-threshold: 3
send-on-resolved: true
description: "DNS {{ record.name }}_{{ record.type }}"
- name: "PING {{ record.name }}_{{ record.type }}"
group: "{{ user }}_dns_private"
url: "icmp://{{ record.name }}"
interval: 2m
conditions:
- "[CONNECTED] == true"
alerts:
- type: ntfy
failure-threshold: 3
send-on-resolved: true
description: "PING {{ record.name }}"
{% endfor %}
{% endfor %}
|