-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.example.yaml
More file actions
173 lines (146 loc) · 5.67 KB
/
config.example.yaml
File metadata and controls
173 lines (146 loc) · 5.67 KB
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
# WebStatusπ Configuration
# Copy this file to config.yaml and customize for your environment
#
# Usage:
# cp config.example.yaml config.yaml
# # Edit config.yaml with your URLs and settings
monitor:
interval: 60 # seconds between check cycles (default: 60)
ssl_warning_days: 30 # days before expiration to warn about SSL certs (default: 30)
# default_user_agent: "Mozilla/5.0 (compatible; WebStatusPi/1.0; +https://github.com/user/webstatuspi)" # Default User-Agent for all requests
urls:
- name: "UB_APP"
url: "https://app.unobravo.com"
timeout: 5 # request timeout in seconds (default: 10)
- name: "UB_WEB"
url: "https://www.unobravo.com"
timeout: 5
- name: "JML"
url: "https://jmlweb.es"
- name: "PLAYAS"
url: "https://playasmurcia.com"
# Content validation examples:
# Keyword validation - check if response contains a specific string
# - name: "API_PROD"
# url: "https://api.example.com/health"
# timeout: 10
# keyword: "OK" # Case-sensitive substring check
# JSON path validation - check if JSON response has expected value at path
# - name: "API_STG"
# url: "https://staging.example.com/api/status"
# timeout: 10
# json_path: "status.healthy" # Checks if data.status.healthy is truthy
# Custom success codes - override default 200-399 success range
# - name: "API_CREATE"
# url: "https://api.example.com/create"
# timeout: 10
# success_codes: [200, 201, 202] # Accept 200, 201, 202 as success
#
# - name: "API_LEGACY"
# url: "https://legacy.example.com/api"
# timeout: 10
# success_codes: ["200-299", 400] # Accept 2xx range and 400
# Latency degradation alerts - alert when response time exceeds threshold
# - name: "CRITICAL_API"
# url: "https://api.example.com/health"
# timeout: 10
# latency_threshold_ms: 2000 # Alert if response time exceeds 2000ms
# latency_consecutive_checks: 3 # Must exceed threshold 3 times in a row (default: 3)
#
# - name: "PAYMENT_API"
# url: "https://payments.example.com"
# timeout: 10
# latency_threshold_ms: 1000 # Alert if response time exceeds 1000ms
# latency_consecutive_checks: 5 # Require 5 consecutive slow checks before alerting
# Custom User-Agent override - useful for bypassing WAFs
# - name: "API_WAF"
# url: "https://api.example.com/health"
# timeout: 10
# user_agent: "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36" # Override User-Agent for this URL
# Add more URLs as needed:
# - name: "MY_SERVICE"
# url: "http://localhost:3000/health"
# timeout: 5
# TCP port monitoring - for non-HTTP services
tcp:
# Example: Database connectivity check
# - name: "DB_PROD"
# host: "db.example.com"
# port: 5432
# timeout: 5
# Example: Redis cache check
# - name: "REDIS"
# host: "redis.example.com"
# port: 6379
# timeout: 3
# Example: Custom service check
# - name: "MSG_QUEUE"
# host: "mq.example.com"
# port: 5672
# timeout: 5
# DNS resolution monitoring - verify domain name resolution
dns:
# Example: Basic DNS resolution check
# - name: "DNS_MAIN"
# host: "example.com"
# record_type: A # A (IPv4) or AAAA (IPv6)
# timeout: 5
# Example: DNS with expected IP verification
# - name: "DNS_API"
# host: "api.example.com"
# record_type: A
# expected_ip: "192.0.2.1" # Verify resolved IP matches
# Example: IPv6 resolution check
# - name: "DNS_V6"
# host: "ipv6.example.com"
# record_type: AAAA
# timeout: 5
database:
path: "./data/status.db" # SQLite database path
retention_days: 7 # Delete checks older than this
vacuum_interval_days: 7 # Run VACUUM to reclaim space every N days (0 to disable)
display:
enabled: true # Enable OLED display (future feature)
cycle_interval: 5 # Seconds between URL display cycles
api:
enabled: true # Enable JSON API server
port: 8080 # API server port
# reset_token: "your-secret-token" # Optional: token required for DELETE /reset
alerts:
webhooks:
# Example: Slack webhook
- url: "https://hooks.slack.com/services/YOUR/SLACK/WEBHOOK"
enabled: true
on_failure: true # Send alert when URL goes DOWN
on_recovery: true # Send alert when URL comes back UP
cooldown_seconds: 300 # Minimum time between alerts for same URL (default: 300)
# Example: Discord webhook
# - url: "https://discord.com/api/webhooks/YOUR/DISCORD/WEBHOOK"
# enabled: true
# on_failure: true
# on_recovery: false # Only alert on failures
# cooldown_seconds: 600
# Example: Generic HTTP webhook (PagerDuty, custom endpoint, etc.)
# - url: "https://events.pagerduty.com/v2/enqueue"
# enabled: true
# on_failure: true
# on_recovery: true
# cooldown_seconds: 300
# Disabled webhook example (not sent)
# - url: "https://example.com/webhook"
# enabled: false
# on_failure: true
# on_recovery: true
# Environment variable overrides (optional):
# - WEBSTATUSPI_MONITOR_INTERVAL: Override monitor.interval
# - WEBSTATUSPI_API_PORT: Override api.port
# - WEBSTATUSPI_API_ENABLED: Override api.enabled (true/false)
# - WEBSTATUSPI_DB_PATH: Override database.path
# - WEBSTATUSPI_DB_RETENTION_DAYS: Override database.retention_days
# Heartbeat monitoring - ping external service to confirm WebStatusPi is running
# If the service doesnt receive a ping, it alerts you that monitoring has stopped
# heartbeat:
# enabled: true
# url: "https://hc-ping.com/your-uuid-here" # Healthchecks.io, Dead Mans Snitch, etc.
# interval_seconds: 300 # Send ping every 5 minutes (default: 300)
# timeout_seconds: 10 # Request timeout (default: 10)