-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig-example.json
317 lines (308 loc) · 13.3 KB
/
config-example.json
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
{
"discord_config": {
"### EXPLANATION OF: server_id ###": "https://support.discord.com/hc/en-us/articles/206346498-Where-can-I-find-my-User-Server-Message-ID",
"server_id": 1234567890123456789,
"### EXPLANATION OF: server_token ###": "Create a new application here and don't forget to link it to your server and allow access to private channels you specify bellow: https://discord.com/developers/applications",
"server_token": "YOUR SERVER TOKEN HERE",
"### EXPLANATION OF: command_prefix ###": "Prefix to use to call the bot - Empty to not have any prefix",
"command_prefix": "/",
"### EXPLANATION OF: channel_name_for_private_commands ###": "Discord channel to ask private and public command - Empty to not have private command handling",
"channel_name_for_private_commands": "🤖 Private Linux monitor CMD 🤖",
"### EXPLANATION OF: channel_name_for_public_commands ###": "Discord channel to ask public command - Empty to not have public command handling",
"channel_name_for_public_commands": "🤖 Public Linux monitor CMD 🤖",
"### EXPLANATION OF: channel_name_for_private_error_tasks ###": "Discord channel where where periodic task will show private and public status issue - Empty to not have public status issue channel",
"channel_name_for_private_error_tasks": "⚠️ Private Linux issues detection ⚠️",
"### EXPLANATION OF: channel_name_for_public_error_tasks ###": "Discord channel where periodic task will show public status issue - Empty to not have public status issue channel",
"channel_name_for_public_error_tasks": "",
"### EXPLANATION OF: channel_name_for_private_infos_tasks ###": "Discord channel where periodic task will show all private info periodically (spam channel) - Empty to not have periodic private channel info",
"channel_name_for_private_infos_tasks": "📢 Private Linux periodic state info 📢",
"### EXPLANATION OF: channel_name_for_public_infos_tasks ###": "Discord channel where periodic task will show all public info periodically (spam channel) - Empty to not have periodic public channel info",
"channel_name_for_public_infos_tasks": "",
"### EXPLANATION OF ALL: welcome_message_for_XXXXX ###": "Message to show when the bot is started specific channel - Empty to not have any message - if not empty and no message sent, it means there is an issue with the bot configuration (no access, ...) so you can check the logs to see what's wrong",
"welcome_message_for_private_commands": "🤖 Linux Monitoring bot started 🤖\n😏 I’m ready to fulfill all your wildest desires 😏\nTo see the available public commands, type `/` in this channel.",
"welcome_message_for_public_commands": "🤖 Linux Monitoring bot started 🤖\n😏 I’m ready to fulfill all your wildest desires 😏\nTo see all available commands, type `/` in this channel.",
"welcome_message_for_private_error_tasks": "🤖 Linux Monitoring bot started 🤖\nI'll inform you if anything private or public goes wrong in the Linux server.",
"welcome_message_for_public_error_tasks": "🤖 Linux Monitoring bot started 🤖\nI'll inform you if anything public goes wrong in the Linux server.",
"welcome_message_for_private_infos_tasks": "🤖 Linux Monitoring bot started 🤖\nI'll inform you periodically about the Linux server public and private status.",
"welcome_message_for_public_infos_tasks": "🤖 Linux Monitoring bot started 🤖\nI'll inform you periodically about the Linux server public status."
},
"basic_config": {
"critical_load_average_percent": 90.0,
"warning_load_average_percent": 80.0,
"critical_cpu_percent": 90.0,
"warning_cpu_percent": 80.0,
"critical_ram_percent": 90.0,
"warning_ram_percent": 80.0,
"critical_swap_percent": 90.0,
"warning_swap_percent": 80.0,
"critical_temperature_celsius": 80.0,
"warning_temperature_celsius": 70.0,
"critical_uptime_seconds": 600,
"warning_uptime_seconds": 3600,
"excluded_interfaces": [
"lo",
"docker0",
"^veth(.*)$",
"^br-(.*)$"
]
},
"scheduled_tasks_check_for_issues": {
"max_duration_seconds_showing_same_error": 36000,
"start_immediately": true,
"duration_in_sec_wait_between_each_execution": 1800
},
"scheduled_tasks_show_infos": {
"start_immediately": false,
"duration_in_sec_wait_between_each_execution": 86400
},
"pings": [
{
"website": "google.com",
"display_name": "Google",
"timeout_in_sec": 5,
"is_private": false
},
{
"website": "www.google.com",
"display_name": "Google (WWW)",
"timeout_in_sec": 5,
"is_private": false
},
{
"website": "123.123.123.123",
"display_name": "A great dummy IP",
"timeout_in_sec": 5,
"is_private": true
}
],
"websites": [
{
"url": "https://google.com",
"display_name": "Google",
"timeout_in_sec": 5,
"is_private": false,
"show_content_if_issue": true,
"service_name_to_restart": "web"
},
{
"url": "https://mock.codes/404",
"display_name": "Example 404 not allowed website",
"timeout_in_sec": 5,
"is_private": true
},
{
"url": "https://mock.codes/401",
"display_name": "Example 401 allowed website",
"additional_allowed_statuses": [401],
"timeout_in_sec": 5,
"is_private": true
},
{
"url": "https://postman-echo.com/basic-auth",
"display_name": "Basic auth website",
"auth_type": "basic",
"username": "postman",
"password": "password",
"timeout_in_sec": 5,
"is_private": true
},
{
"url": "https://postman-echo.com/bearer-auth",
"display_name": "Bearer auth website (no mock, will fail)",
"auth_type": "bearer",
"token": "12345678901234567890",
"timeout_in_sec": 5,
"is_private": true
}
],
"disks": [
{
"device": "/",
"display_name": "Main hard drive",
"warning_percent": 60,
"critical_percent": 80,
"is_private": false
},
{
"device": "/boot",
"display_name": "Boot drive",
"warning_percent": 60,
"critical_percent": 80,
"is_private": true
}
],
"folders": [
{
"folder_path": "/var/www/",
"display_name": "Base apache folder",
"warning_usage_giga": 20,
"critical_usage_giga": 100,
"is_private": false
},
{
"folder_path": "/var/log/",
"display_name": "Log folder",
"warning_usage_giga": 15,
"critical_usage_giga": 40,
"is_private": true
}
],
"services":
{
"web": {
"display_name": "Web server (Apache)",
"restart_command": "sudo /etc/init.d/apache2 restart",
"status_command": "sudo /etc/init.d/apache2 status",
"timeout_in_sec": 30,
"is_private": false,
"auto_restart": true
},
"sql": {
"display_name": "SQL server (MariaDB)",
"restart_command": "sudo /etc/init.d/mariadb restart",
"status_command": "sudo /etc/init.d/mariadb status",
"timeout_in_sec": 30,
"is_private": false,
"auto_restart": true
},
"rdp": {
"display_name": "RDP (xrdp)",
"restart_command": "sudo systemctl restart xrdp",
"stop_command": "sudo systemctl stop xrdp",
"status_command": "sudo systemctl is-active xrdp",
"timeout_in_sec": 30,
"is_private": true,
"auto_restart": false
}
},
"certificates": [
{
"website": "amazon.com",
"display_name": "Example of valid certificate",
"warning_remaining_days": 15,
"critical_remaining_days": 5,
"is_private": false
},
{
"website": "www.amazon.com",
"display_name": "Example of requested 4000 days certificate (for error catching example only)",
"warning_remaining_days": 8000,
"critical_remaining_days": 4000,
"is_private": true
},
{
"website": "expired.badssl.com",
"display_name": "Example of expired certificate (considered invalid)",
"warning_remaining_days": 15,
"critical_remaining_days": 5,
"is_private": true
},
{
"website": "self-signed.badssl.com",
"display_name": "Example of self-signed certificate (considered invalid)",
"warning_remaining_days": 15,
"critical_remaining_days": 5,
"is_private": true
}
],
"recent_user_connections": {
"allow_all": false,
"max_days": 1,
"allowed_ips": [
"111.222.111.222",
"123.123.123.123"
]
},
"ports": [
{
"port": 80,
"host": "localhost",
"display_name": "Web server (unsecured)",
"want_port_to_be_open": true,
"service_name_to_restart": "web",
"timeout_in_sec": 5,
"is_private": false
},
{
"port": 443,
"host": "localhost",
"display_name": "Web server (secured)",
"want_port_to_be_open": true,
"service_name_to_restart": "web",
"timeout_in_sec": 5,
"is_private": false
},
{
"port": 3306,
"host": "localhost",
"display_name": "SQL Server (internal)",
"want_port_to_be_open": true,
"service_name_to_restart": "sql",
"timeout_in_sec": 10,
"is_private": false
},
{
"port": 3389,
"host": "localhost",
"display_name": "RDP",
"want_port_to_be_open": true,
"service_name_to_restart": "rdp",
"timeout_in_sec": 10,
"is_private": true
}
],
"commands":
{
"banned_ips": {
"display_name": "IP bannies",
"command": "sudo fail2ban-client banned",
"is_private": true,
"show_content_if_success": true,
"show_content_if_issue": true,
"is_content_json": true,
"execute_in_scheduled_tasks_for_issues": false,
"execute_in_scheduled_tasks_for_infos": true,
"timeout_in_sec": 60
},
"update": {
"display_name": "Màj serveur 1/3 (Package update)",
"command": "sudo /usr/bin/apt-get update -q >/dev/null && { output=$(/usr/bin/apt list --upgradable 2>/dev/null | /usr/bin/grep -E 'upgradable from'); if [ -z \"$output\" ]; then /usr/bin/echo \"Packages already updated\"; else /usr/bin/echo \"$output\"; fi; }",
"is_private": true,
"show_content_if_success": true,
"show_content_if_issue": true,
"execute_in_scheduled_tasks_for_issues": false,
"execute_in_scheduled_tasks_for_infos": true,
"timeout_in_sec": 1200
},
"upgrade": {
"display_name": "Màj serveur 2/3 (Package upgrade)",
"command": "sudo /usr/bin/apt-get -q -y upgrade >&1 | /usr/bin/grep -E '^[0-9]+ upgraded,(.*)$'",
"is_private": true,
"show_content_if_success": true,
"show_content_if_issue": true,
"execute_in_scheduled_tasks_for_issues": false,
"execute_in_scheduled_tasks_for_infos": true,
"timeout_in_sec": 1200
},
"dpkg": {
"display_name": "Màj serveur 3/3 (Configure debian packages)",
"command": "sudo /usr/bin/dpkg --configure -a",
"is_private": true,
"show_content_if_success": true,
"show_content_if_issue": true,
"execute_in_scheduled_tasks_for_issues": false,
"execute_in_scheduled_tasks_for_infos": true,
"timeout_in_sec": 1200
},
"certificates": {
"display_name": "Renouvellement certificats",
"command": "output=$(sudo /usr/bin/certbot renew --quiet --renew-hook '/usr/bin/echo \"\\nCertificat ${RENEWED_LINEAGE} mis à jour (ce qui met à jour les noms de domaines suivants: ${RENEWED_DOMAINS})\\n\" >&2'); if [[ -n \"$output\" ]]; then /usr/bin/echo \"Service FTP relancé car dépend des certificats\"; sudo /etc/init.d/proftpd restart >/dev/null 2>&1; else /usr/bin/echo \"All certificates are already up to date\"; fi",
"is_private": true,
"show_content_if_success": true,
"show_content_if_issue": true,
"execute_in_scheduled_tasks_for_issues": false,
"execute_in_scheduled_tasks_for_infos": true,
"timeout_in_sec": 1200
}
}
}