forked from megaease/easeprobe
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.yaml
456 lines (423 loc) · 19.2 KB
/
config.yaml
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
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
# --------------------- HTTP Probe Configuration ---------------------
# http:
# # A completed HTTP Probe configuration
# - name: Special Website
# url: https://megaease.cn
# # Proxy setting, support sock5, http, https, for example:
# # proxy: http://proxy.server:8080
# # proxy: socks5://localhost:1085
# # proxy: https://user:[email protected]:443
# # Also support `HTTP_PROXY` & `HTTPS_PROXY` environment variables
# proxy: http://proxy.server:8080
# # Request Method
# method: GET
# # Request Header
# headers:
# User-Agent: Customized User-Agent # default: "MegaEase EaseProbe / v1.6.0"
# X-head-one: xxxxxx
# X-head-two: yyyyyy
# X-head-THREE: zzzzzzX-
# content_encoding: text/json
# # Request Body
# body: '{ "FirstName": "Mega", "LastName" : "Ease", "UserName" : "megaease", "Email" : "[email protected]"}'
# # HTTP Basic Auth
# username: username
# password: password
# # mTLS
# ca: /path/to/file.ca
# cert: /path/to/file.crt
# key: /path/to/file.key
# # TLS
# insecure: true # skip any security checks, useful for self-signed and expired certs. default: false
# # HTTP successful response code range, default is [0, 499].
# success_code:
# - [200,206] # the code >=200 and <= 206
# - [300,308] # the code >=300 and <= 308
# # Response Checking
# contain: "success" # response body must contain this string, if not the probe is considered failed.
# not_contain: "failure" # response body must NOT contain this string, if it does the probe is considered failed.
# regex: false # if true, the contain and not_contain will be treated as regular expression. default: false
# eval: # eval is a expression evaluation for HTTP response message
# doc: XML # support XML, JSON, HTML, TEXT.
# expression: "x_time('//feed/updated') > '2022-07-01'" # the expression to evaluate.
# # configuration
# timeout: 10s # default is 30 seconds
# failure: 2 # number of consecutive failed probes needed to determine the status down, default: 1
# success: 1 # number of consecutive successful probes needed to determine the status up , default: 1
http: # http probes
- name: EaseProbe Github
url: https://github.com/megaease/easeprobe
# --------------------- TCP Probe Configuration ---------------------
#
# tcp:
# - name: SSH Service
# host: example.com:22
# timeout: 10s # default is 30 seconds
# interval: 2m # default is 60 seconds
# proxy: socks5://proxy.server:1080 # Optional. Only support socks5.
# # Also support the `ALL_PROXY` environment.
# failure: 2 # number of consecutive failed probes needed to determine the status down, default: 1
# success: 1 # number of consecutive successful probes needed to determine the status up, default: 1
# --------------------- Ping Probe Configuration ---------------------
#
# ping:
# - name: Localhost
# host: 127.0.0.1
# count: 5 # number of packets to send, default: 3
# lost: 0.2 # 20% lost percentage threshold, mark it down if the loss is greater than this, default: 0
# privileged: true # if true, the ping will be executed with icmp, otherwise use udp, default: false (Note: On Windows platform, this must be set to True)
# timeout: 10s # default is 30 seconds
# interval: 2m # default is 60 seconds
# --------------------- Shell Probe Configuration ---------------------
#
# shell:
# # run redis-cli ping and check the "PONG"
# - name: Redis (Local)
# cmd: "redis-cli"
# args:
# - "-h"
# - "127.0.0.1"
# - "ping"
# clean_env: true # Do not pass the OS environment variables to the command
# # default: false
# env:
# # set the `REDISCLI_AUTH` environment variable for redis password
# - "REDISCLI_AUTH=abc123"
# # check the command output, if does not contain the PONG, mark the status down
# contain : "PONG"
# not_contain: "failure" # response body must NOT contain this string, if it does the probe is considered failed.
# regex: false # if true, the `contain` and `not_contain` will be treated as regular expression. default: false
# --------------------- SSH Probe Configuration ---------------------
#
# SSH Probe Configuration
# ssh:
# # SSH bastion host configuration
# bastion:
# aws: # bastion host ID ◄──────────────────────────────┐
# host: aws.basition.com:22 # │
# username: ubuntu # login user │
# key: /path/to/aws/basion/key.pem # private key file │
# gcp: # bastion host ID │
# host: [email protected]:22 # bastion host │
# key: /path/to/gcp/basion/key.pem # private key file │
# # SSH Probe configuration │
# servers: # │
# # run redis-cli ping and check the "PONG" │
# - name: Redis (AWS) # Name │
# bastion: aws # bastion host id ------------------------─┘
# host: 172.20.2.202:22
# username: ubuntu # SSH Login username
# password: xxxxx # SSH Login password
# key: /path/to/private.key # SSH login private file
# passphrase: xxxxxxx # PrivateKey password
# cmd: "redis-cli"
# args:
# - "-h"
# - "127.0.0.1"
# - "ping"
# env:
# # set the `REDISCLI_AUTH` environment variable for redis password
# - "REDISCLI_AUTH=abc123"
# # check the command output, if does not contain the PONG, mark the status down
# contain : "PONG"
# not_contain: "failure" # response body must NOT contain this string, if it does the probe is considered failed.
# regex: false # if true, the contain and not_contain will be treated as regular expression. default: false
# # Check the process status of `Kafka`
# - name: Kafka (GCP)
# bastion: gcp # ◄------ bastion host id
# host: 172.10.1.100:22
# username: ubuntu
# key: /path/to/private.key
# cmd: "ps -ef | grep kafka"
# --------------------- TLS Probe Configuration ---------------------
#
# tls:
# - name: expired test
# host: expired.badssl.com:443
# proxy: socks5://proxy.server:1080 # Optional. Only support socks5.
# # Also support the `ALL_PROXY` environment.
# insecure_skip_verify: true # don't check cert validity
# expire_skip_verify: true # don't check cert expire date
# alert_expire_before: 168h # alert if cert expire date is before X, the value is a Duration,
# # see https://pkg.go.dev/time#ParseDuration. example: 1h, 1m, 1s.
# # expire_skip_verify must be false to use this feature.
# # root_ca_pem_path: /path/to/root/ca.pem # ignore if root_ca_pem is present
# # root_ca_pem: |
# # -----BEGIN CERTIFICATE-----
# - name: untrust test
# host: untrusted-root.badssl.com:443
# # insecure_skip_verify: true # don't check cert validity
# # expire_skip_verify: true # don't check cert expire date
# # root_ca_pem_path: /path/to/root/ca.pem # ignore if root_ca_pem is present
# # root_ca_pem: |
# # -----BEGIN CERTIFICATE-----
# --------------------- Host Probe Configuration ---------------------
# host:
# bastion: # bastion server configuration
# aws: # bastion host ID ◄──────────────────┐
# host: [email protected] # bastion host │
# key: /path/to/bastion.pem # private key file │
# # Servers List │
# servers: # │
# - name : aws server # │
# bastion: aws # <-- bastion server id ------─┘
# host: [email protected]:22
# key: /path/to/server.pem
# disks: # [optional] Check multiple disks. if not present, only check `/` by default
# - /
# - /data
# threshold:
# cpu: 0.80 # cpu usage 80%
# mem: 0.70 # memory usage 70%
# disk: 0.90 # disk usage 90%
# load: # load average - Note: the actual load would be divided by cpu core number, the threshold won't consider the cpu core number.
# m1: 0.5 # 1 minute load average 0.5 (default: 0.8)
# m5: 0.9 # 5 minute load average 0.9 (default: 0.8)
# m15: 0.9 # 15 minute load average 0.9 (default: 0.8)
# # Using the default threshold
# # cpu 80%, mem 80%, disk 95% and 0.8 load average
# - name : My VPS
# host: [email protected]:22
# key: /Users/user/.ssh/id_rsa
# --------------------- Native Client Probe Configuration ---------------------
#
# client:
# - name: Redis Native Client (local)
# driver: "redis" # driver is redis
# host: "localhost:6379" # server and port
# password: "abc123" # password
# data: # Optional
# key: val # Check that `key` exists and its value is `val`
# # mTLS - Optional
# ca: /path/to/file.ca
# cert: /path/to/file.crt
# key: /path/to/file.key
# - name: MySQL Native Client (local)
# driver: "mysql"
# host: "localhost:3306"
# username: "root"
# password: "pass"
# data: # Optional, check the specific column value in the table
# # Usage: "database:table:column:primary_key:value" : "expected_value"
# # transfer to : "SELECT column FROM database.table WHERE primary_key = value"
# # the `value` for `primary_key` must be int
# "test:product:name:id:1" : "EaseProbe" # select name from test.product where id = 1
# "test:employee:age:id:2" : 45 # select age from test.employee where id = 2
# # mTLS - Optional
# ca: /path/to/file.ca
# cert: /path/to/file.crt
# key: /path/to/file.key
# - name: MongoDB Native Client (local)
# driver: "mongo"
# host: "localhost:27017"
# username: "admin"
# password: "abc123"
# timeout: 5s
# data: # Optional, find the specific value in the table
# # Usage: "database:collection" : "{JSON}"
# "test:employee" : '{"name":"Hao Chen"}' # find the employee with name "Hao Chen"
# "test:product" : '{"name":"EaseProbe"}' # find the product with name "EaseProbe"
# - name: Memcache Native Client (local)
# driver: "memcache"
# host: "localhost:11211"
# timeout: 5s
# data: # Optional
# key: val # Check that key exists and its value is val
# "namespace:key": val # Namespaced keys enclosed in "
# - name: Kafka Native Client (local)
# driver: "kafka"
# host: "localhost:9093"
# # mTLS - Optional
# ca: /path/to/file.ca
# cert: /path/to/file.crt
# key: /path/to/file.key
# - name: PostgreSQL Native Client (local)
# driver: "postgres"
# host: "localhost:5432"
# username: "postgres"
# password: "pass"
# data: # Optional, check the specific column value in the table
# # Usage: "database:table:column:primary_key:value" : "expected_value"
# # transfer to : "SELECT column FROM table WHERE primary_key = value"
# # the `value` for `primary_key` must be int
# "test:product:name:id:1" : "EaseProbe" # select name from product where id = 1
# "test:employee:age:id:2" : 45 # select age from employee where id = 2
# # mTLS - Optional
# ca: /path/to/file.ca
# cert: /path/to/file.crt
# key: /path/to/file.key
# - name: Zookeeper Native Client (local)
# driver: "zookeeper"
# host: "localhost:2181"
# timeout: 5s
# data: # Optional, check the specific value in the path
# "/path/to/key": "value" # Check that the value of the `/path/to/key` is "value"
# # mTLS - Optional
# ca: /path/to/file.ca
# cert: /path/to/file.crt
# key: /path/to/file.key
# --------------------- Notification Configuration ---------------------
#
# notify:
# log:
# - name: log file # local log file
# file: /var/log/easeprobe.log
# - name: Remote syslog # syslog (!!! Not For Windows !!!)
# file: syslog # <-- must be "syslog" keyword
# host: 127.0.0.1:514 # remote syslog server - optional
# network: udp #remote syslog network [tcp, udp] - optional
# slack:
# - name: "MegaEase#Alert"
# webhook: "https://hooks.slack.com/services/........../....../....../"
# discord:
# - name: "MegaEase#Alert"
# webhook: "https://discord.com/api/webhooks/...../....../"
# telegram:
# - name: "MegaEase Alert Group"
# token: 1234567890:ABCDEFGHIJKLMNOPQRSTUVWXYZ # Bot Token
# chat_id: -123456789 # Channel / Group ID
# email:
# - name: "DevOps Mailing List"
# server: smtp.email.example.com:465
# username: [email protected]
# password: ********
# to: "[email protected];[email protected]"
# aws_sns:
# - name: AWS SNS
# region: us-west-2
# arn: arn:aws:sns:us-west-2:298305261856:xxxxx
# endpoint: https://sns.us-west-2.amazonaws.com
# credential:
# id: AWSXXXXXXXID
# key: XXXXXXXX/YYYYYYY
# wecom:
# - name: "wecom alert service"
# webhook: "https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=589f9674-a2aa-xxxxxxxx-16bb6c43034a" # wecom robot webhook
# dingtalk:
# - name: "dingtalk alert service"
# webhook: "https://oapi.dingtalk.com/robot/send?access_token=xxxx"
# secret: "" # sign secret if set
# lark:
# - name: "lark alert service"
# webhook: "https://open.feishu.cn/open-apis/bot/v2/hook/d5366199-xxxx-xxxx-bd81-a57d1dd95de4"
# sms:
# - name: "sms alert service"
# provider: "yunpian"
# key: xxxxxxxxxxxx # yunpian apikey
# mobile: 123456789,987654321 # mobile phone number, multiple phone number joint by `,`
# sign: "xxxxxxxx" # need to register; usually brand name
# teams:
# - name: "teams alert service"
# webhook: "https://outlook.office365.com/webhook/a1269812-6d10-44b1-abc5-b84f93580ba0@9e7b80c7-d1eb-4b52-8582-76f921e416d9/IncomingWebhook/3fdd6767bae44ac58e5995547d66a4e4/f332c8d9-3397-4ac5-957b-b8e3fc465a8c" # see https://docs.microsoft.com/en-us/outlook/actionable-messages/send-via-connectors
# shell: # EaseProbe set the environment variables -
# # (see the example: resources/scripts/notify/notify.sh)
# - name: "shell alert service"
# cmd: "/bin/bash"
# args:
# - "-c"
# - "/path/to/script.sh"
# env: # set the env to the notification command
# - "EASEPROBE=1"
# ringcentral:
# - name: "RingCentral alert service"
# webhook: "https://hooks.ringcentral.com/webhook/v2/.........."
notify:
log:
- name: log file # local log file
file: /var/log/easeprobe.log
# --------------------- Global Settings Configuration ---------------------
# Global settings for all probes and notifiers.
# settings:
# # The customized name and icon
# name: "EaseProbe" # the name of the probe: default: "EaseProbe"
# icon: "https://path/to/icon.png" # the icon of the probe. default: "https://megaease.com/favicon.png"
# # Daemon settings
# # pid file path, default: $CWD/easeprobe.pid,
# # if set to "", will not create pid file.
# pid: /var/run/easeprobe.pid
# # A HTTP Server configuration
# http:
# ip: 127.0.0.1 # the IP address of the server. default:"0.0.0.0"
# port: 8181 # the port of the server. default: 8181
# refresh: 5s # the auto-refresh interval of the server. default: the minimum value of the probes' interval.
# log:
# file: /path/to/access.log # access log file. default: Stdout
# # Log Rotate Configuration (optional)
# self_rotate: true # true: self rotate log file. default: true
# # false: managed by outside (e.g logrotate)
# # the blow settings will be ignored.
# size: 10 # max of access log file size. default: 10m
# age: 7 # max of access log file age. default: 7 days
# backups: 5 # max of access log file backups. default: 5
# compress: true # compress the access log file. default: true
# # SLA Report schedule
# sla:
# # minutely, hourly, daily, weekly (Sunday), monthly (Last Day), none
# schedule : "daily"
# # the time to send the SLA report. Ignored on hourly and minutely schedules
# - the format is 'hour:min:sec'
# # - the timezone can be configured by `settings.timezone`, default is UTC
# time: "23:59"
# # SLA data persistence file path.
# # The default location is `$CWD/data/data.yaml`
# data: /path/to/data/file.yaml
# # Use the following to disable SLA data persistence
# # data: "-"
# backups: 5 # max of SLA data file backups. default: 5
# # if set to a negative value, keep all backup files
# notify:
# # dry: true # Global settings for dry run
# retry: # Global settings for retry
# times: 5
# interval: 10s
# probe:
# timeout: 30s # the time out for all probes
# interval: 1m # probe every minute for all probes
# failure: 2 # number of consecutive failed probes needed to determine the status down, default: 1
# success: 1 # number of consecutive successful probes needed to determine the status up, default: 1
# alert: # alert interval for all probes
# strategy: "regular" # it can be "regular", "increment" or "exponent", default: "regular"
# factor: 1 # the factor of the interval, default: 1
# max: 5 # the max of the alert, default: 1
#
# # easeprobe program running log file.
# log:
# file: "/path/to/easeprobe.log" # default: stdout
# # Log Level Configuration
# # can be: panic, fatal, error, warn, info, debug.
# level: "debug"
# # Log Rotate Configuration (optional)
# self_rotate: true # true: self rotate log file. default: true
# # false: managed by outside (e.g logrotate)
# # the blow settings will be ignored.
# size: 10 # max of access log file size. default: 10m
# age: 7 # max of access log file age. default: 7 days
# backups: 5 # max of access log file backups. default: 5
# compress: true # compress the access log file. default: true
# # Date format
# # Date
# # - January 2, 2006
# # - 01/02/06
# # - Jan-02-06
# #
# # Time
# # - 15:04:05
# # - 3:04:05 PM
# #
# # Date Time
# # - Jan _2 15:04:05 (Timestamp)
# # - Jan _2 15:04:05.000000 (with microseconds)
# # - 2006-01-02T15:04:05-0700 (ISO 8601 (RFC 3339))
# # - 2006-01-02 15:04:05
# # - 02 Jan 06 15:04 MST (RFC 822)
# # - 02 Jan 06 15:04 -0700 (with numeric zone)
# # - Mon, 02 Jan 2006 15:04:05 MST (RFC 1123)
# # - Mon, 02 Jan 2006 15:04:05 -0700 (with numeric zone)
# timeformat: "2006-01-02 15:04:05 Z07:00"
# # check the following link to see the time zone list
# # https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
# timezone: "America/New_York" # default: UTC
settings:
probe:
timeout: 30s # the time out for all probes
interval: 1m # probe every minute for all probes