feat: Support multiple configuration files (#389)
* Allow configuration to be distributed * catch iteration errors when collecting config files * rm unused func * Fix suffix check for config loading * test configuration loading * GATUS_CONFIG_PATH can be a file or a directory now * Add deprecation note * Fix cs Co-authored-by: TwiN <twin@linux.com> * cs fixes Co-authored-by: TwiN <twin@linux.com> * cs fixes Co-authored-by: TwiN <twin@linux.com> * cs fixes Co-authored-by: TwiN <twin@linux.com> * cs + rm useless line Co-authored-by: TwiN <twin@linux.com> * Update config/config.go Co-authored-by: TwiN <twin@linux.com>
This commit is contained in:
24
test-conf/conf.d/endpoints.yaml
Normal file
24
test-conf/conf.d/endpoints.yaml
Normal file
@ -0,0 +1,24 @@
|
||||
endpoints:
|
||||
- name: front-end
|
||||
group: core
|
||||
url: "https://twin.sh/health"
|
||||
interval: 5m
|
||||
conditions:
|
||||
- "[STATUS] == 200"
|
||||
- "[BODY].status == UP"
|
||||
- "[RESPONSE_TIME] < 150"
|
||||
|
||||
- name: back-end
|
||||
group: core
|
||||
url: "https://example.org/"
|
||||
interval: 5m
|
||||
conditions:
|
||||
- "[STATUS] == 200"
|
||||
- "[CERTIFICATE_EXPIRATION] > 48h"
|
||||
|
||||
- name: monitoring
|
||||
group: internal
|
||||
url: "https://example.org/"
|
||||
interval: 5m
|
||||
conditions:
|
||||
- "[STATUS] == 200"
|
29
test-conf/conf.d/endpoints.yml
Normal file
29
test-conf/conf.d/endpoints.yml
Normal file
@ -0,0 +1,29 @@
|
||||
endpoints:
|
||||
- name: nas
|
||||
group: internal
|
||||
url: "https://example.org/"
|
||||
interval: 5m
|
||||
conditions:
|
||||
- "[STATUS] == 200"
|
||||
|
||||
- name: example-dns-query
|
||||
url: "8.8.8.8" # Address of the DNS server to use
|
||||
interval: 5m
|
||||
dns:
|
||||
query-name: "example.com"
|
||||
query-type: "A"
|
||||
conditions:
|
||||
- "[BODY] == 93.184.216.34"
|
||||
- "[DNS_RCODE] == NOERROR"
|
||||
|
||||
- name: icmp-ping
|
||||
url: "icmp://example.org"
|
||||
interval: 1m
|
||||
conditions:
|
||||
- "[CONNECTED] == true"
|
||||
|
||||
- name: check-domain-expiration
|
||||
url: "https://example.org/"
|
||||
interval: 1h
|
||||
conditions:
|
||||
- "[DOMAIN_EXPIRATION] > 720h"
|
6
test-conf/config.yaml
Normal file
6
test-conf/config.yaml
Normal file
@ -0,0 +1,6 @@
|
||||
endpoints:
|
||||
- name: example
|
||||
url: https://example.org
|
||||
interval: 30s
|
||||
conditions:
|
||||
- "[STATUS] == 200"
|
0
test-conf/empty-conf.d/.gitignore
vendored
Normal file
0
test-conf/empty-conf.d/.gitignore
vendored
Normal file
Reference in New Issue
Block a user