-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathletsencrypt.xml
334 lines (334 loc) · 15.9 KB
/
letsencrypt.xml
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
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
<?xml version="1.0" encoding="UTF-8"?>
<zabbix_export>
<version>5.0</version>
<date>2020-09-19T20:42:16Z</date>
<groups>
<group>
<name>Templates</name>
</group>
</groups>
<templates>
<template>
<template>Lets Encrypt SSL Certificate</template>
<name>Lets Encrypt SSL Certificate</name>
<groups>
<group>
<name>Templates</name>
</group>
</groups>
<applications>
<application>
<name>Le't Encrypt</name>
</application>
</applications>
<items>
<item>
<name>certbot version</name>
<key>system.run[/usr/bin/certbot --version]</key>
<delay>900s</delay>
<value_type>FLOAT</value_type>
<description>Get the version of certbot</description>
<applications>
<application>
<name>Le't Encrypt</name>
</application>
</applications>
<preprocessing>
<step>
<type>LTRIM</type>
<params>certbot </params>
</step>
</preprocessing>
<triggers>
<trigger>
<expression>{last()}=0</expression>
<name>Hey! {HOST.NAME} has an outdated certbot install</name>
<priority>INFO</priority>
<description>If version is below 0.28.0 then SNI certs are permitted and SSL renewal will not work</description>
</trigger>
</triggers>
</item>
<item>
<name>Renew certificate</name>
<key>system.run[sudo certbot renew --pre-hook "service nginx stop" --dry-run --post-hook "service nginx start"]</key>
<delay>30s</delay>
<trends>0</trends>
<status>DISABLED</status>
<value_type>TEXT</value_type>
<description>Warning: There's some sharp edges here. Just be very aware of what you're entering into before proceeding.
Ideally of course, one would have the script hook also move the new cert into place, but let's walk before we run.</description>
<applications>
<application>
<name>Le't Encrypt</name>
</application>
</applications>
</item>
<item>
<name>certbot sources list jessie</name>
<key>vfs.file.exists[/etc/apt/sources.list.d/certbot-certbot-jessie.list]</key>
<delay>90s</delay>
<description>sources file has to exist in order to install the package.
NB: Need to find a better way to check based on distro name</description>
<applications>
<application>
<name>Le't Encrypt</name>
</application>
</applications>
<preprocessing>
<step>
<type>BOOL_TO_DECIMAL</type>
<params/>
</step>
</preprocessing>
<request_method>POST</request_method>
</item>
<item>
<name>certbot sources list stretch</name>
<key>vfs.file.exists[/etc/apt/sources.list.d/certbot-certbot-stretch.list]</key>
<delay>90s</delay>
<description>sources file has to exist in order to install the package.
NB: Need to find a better way to check based on distro name</description>
<applications>
<application>
<name>Le't Encrypt</name>
</application>
</applications>
<preprocessing>
<step>
<type>BOOL_TO_DECIMAL</type>
<params/>
</step>
</preprocessing>
<request_method>POST</request_method>
</item>
<item>
<name>certbot sources list trusty</name>
<key>vfs.file.exists[/etc/apt/sources.list.d/certbot-certbot-trusty.list]</key>
<delay>90s</delay>
<description>sources file has to exist in order to install the package.
NB: Need to find a better way to check based on distro name</description>
<applications>
<application>
<name>Le't Encrypt</name>
</application>
</applications>
<preprocessing>
<step>
<type>BOOL_TO_DECIMAL</type>
<params/>
</step>
</preprocessing>
<request_method>POST</request_method>
</item>
<item>
<name>certbot sources list xenial</name>
<key>vfs.file.exists[/etc/apt/sources.list.d/certbot-certbot-xenial.list]</key>
<delay>90s</delay>
<description>sources file has to exist in order to install the package.
NB: Need to find a better way to check based on distro name</description>
<applications>
<application>
<name>Le't Encrypt</name>
</application>
</applications>
<preprocessing>
<step>
<type>BOOL_TO_DECIMAL</type>
<params/>
</step>
</preprocessing>
<request_method>POST</request_method>
</item>
<item>
<name>certbot sources list bionic</name>
<key>vfs.file.exists[/etc/apt/sources.list.d/certbot-ubuntu-certbot-bionic.list]</key>
<delay>90s</delay>
<description>sources file has to exist in order to install the package.
NB: Need to find a better way to check based on distro name</description>
<applications>
<application>
<name>Le't Encrypt</name>
</application>
</applications>
<preprocessing>
<step>
<type>BOOL_TO_DECIMAL</type>
<params/>
</step>
</preprocessing>
<request_method>POST</request_method>
</item>
<item>
<name>certbot sources list focal</name>
<key>vfs.file.exists[/etc/apt/sources.list.d/certbot-ubuntu-certbot-focal.list]</key>
<delay>90s</delay>
<description>sources file has to exist in order to install the package.
NB: Need to find a better way to check based on distro name</description>
<applications>
<application>
<name>Le't Encrypt</name>
</application>
</applications>
<preprocessing>
<step>
<type>BOOL_TO_DECIMAL</type>
<params/>
</step>
</preprocessing>
</item>
<item>
<name>certbot package snap</name>
<key>vfs.file.exists[/snap/bin/certbot]</key>
<delay>90s</delay>
<description>the package which actually creates certificates. This is pretty much a given.</description>
<applications>
<application>
<name>Le't Encrypt</name>
</application>
</applications>
<preprocessing>
<step>
<type>BOOL_TO_DECIMAL</type>
<params/>
</step>
</preprocessing>
</item>
<item>
<name>software-properties-common package</name>
<key>vfs.file.exists[/usr/bin/add-apt-repository]</key>
<delay>90s</delay>
<description>/usr/bin/add-apt-repository must exist for the software-properties-common package to be installed</description>
<applications>
<application>
<name>Le't Encrypt</name>
</application>
</applications>
<request_method>POST</request_method>
<triggers>
<trigger>
<expression>{last(0)}=0</expression>
<name>Hey! {HOST.NAME} has no software-properties-common package installed</name>
<priority>INFO</priority>
</trigger>
</triggers>
</item>
<item>
<name>certbot package</name>
<key>vfs.file.exists[/usr/bin/certbot]</key>
<delay>90s</delay>
<description>the package which actually creates certificates. This is pretty much a given.</description>
<applications>
<application>
<name>Le't Encrypt</name>
</application>
</applications>
<preprocessing>
<step>
<type>BOOL_TO_DECIMAL</type>
<params/>
</step>
</preprocessing>
<request_method>POST</request_method>
</item>
<item>
<name>python-pycurl Package</name>
<key>vfs.file.exists[/usr/share/doc/python-pycurl/copyright]</key>
<delay>90s</delay>
<description>python-pycurl package is required when generating the SSL certificates</description>
<applications>
<application>
<name>Le't Encrypt</name>
</application>
</applications>
<preprocessing>
<step>
<type>BOOL_TO_DECIMAL</type>
<params/>
</step>
</preprocessing>
<request_method>POST</request_method>
<triggers>
<trigger>
<expression>{last(0)}=0</expression>
<name>Hey! {HOST.NAME} has no python-pycurl package installed</name>
<priority>INFO</priority>
<description>If /usr/bin/unattended-upgrade binary doesn't exist then package unattended-upgrades is not installed and therefore, alert us to this fact.</description>
</trigger>
</triggers>
</item>
<item>
<name>python-software-properties Package</name>
<key>vfs.file.exists[/usr/share/doc/python-software-properties/README]</key>
<delay>90s</delay>
<description>If this README does not exist, then python-software-properties package is not installed.</description>
<applications>
<application>
<name>Le't Encrypt</name>
</application>
</applications>
<preprocessing>
<step>
<type>BOOL_TO_DECIMAL</type>
<params/>
</step>
</preprocessing>
<request_method>POST</request_method>
</item>
<item>
<name>software-properties-common Package</name>
<key>vfs.file.exists[/usr/share/doc/software-properties-common/copyright]</key>
<delay>90s</delay>
<description>If this README does not exist, then python-software-properties package is not installed.</description>
<applications>
<application>
<name>Le't Encrypt</name>
</application>
</applications>
<preprocessing>
<step>
<type>BOOL_TO_DECIMAL</type>
<params/>
</step>
</preprocessing>
<request_method>POST</request_method>
</item>
</items>
</template>
</templates>
<triggers>
<trigger>
<expression>{Lets Encrypt SSL Certificate:vfs.file.exists[/usr/bin/certbot].last(0)}=0 and
{Lets Encrypt SSL Certificate:vfs.file.exists[/snap/bin/certbot].last()}=0</expression>
<name>Hey! {HOST.NAME} has no certbot package installed</name>
<priority>INFO</priority>
</trigger>
<trigger>
<expression>{Lets Encrypt SSL Certificate:vfs.file.exists[/etc/apt/sources.list.d/certbot-certbot-trusty.list].last(0)}=0 and
{Lets Encrypt SSL Certificate:vfs.file.exists[/etc/apt/sources.list.d/certbot-certbot-xenial.list].last(0)}=0 and
{Lets Encrypt SSL Certificate:vfs.file.exists[/etc/apt/sources.list.d/certbot-ubuntu-certbot-bionic.list].last(0)}=0 and
{Lets Encrypt SSL Certificate:vfs.file.exists[/etc/apt/sources.list.d/certbot-ubuntu-certbot-focal.list].last(0)}=0 and
{Lets Encrypt SSL Certificate:vfs.file.exists[/etc/apt/sources.list.d/certbot-certbot-jessie.list].last(0)}=0 and
{Lets Encrypt SSL Certificate:vfs.file.exists[/etc/apt/sources.list.d/certbot-certbot-stretch.list].last(0)}=0 and
{Lets Encrypt SSL Certificate:vfs.file.exists[/usr/bin/certbot].last()}=0 and
{Lets Encrypt SSL Certificate:vfs.file.exists[/snap/bin/certbot].last()}=0</expression>
<name>Hey! {HOST.NAME} has no Let's Encrypt PPA added</name>
<priority>INFO</priority>
<description>Alert if the sources list does not exist, since we therefore, cannot install packages.</description>
</trigger>
<trigger>
<expression>{Lets Encrypt SSL Certificate:vfs.file.exists[/usr/share/doc/python-software-properties/README].last(0)}=0 and
{Lets Encrypt SSL Certificate:vfs.file.exists[/usr/bin/add-apt-repository].last(0)}=0 and
{Lets Encrypt SSL Certificate:vfs.file.exists[/usr/bin/certbot].last()}=0</expression>
<name>Hey! {HOST.NAME} has no python-software-properties or software-properties-common package installed</name>
<priority>INFO</priority>
<description>Alert if the packages are installed</description>
</trigger>
</triggers>
</zabbix_export>