summaryrefslogtreecommitdiff
path: root/internal/config.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/config.go')
-rw-r--r--internal/config.go12
1 files changed, 9 insertions, 3 deletions
diff --git a/internal/config.go b/internal/config.go
index 5d172d6..c3a0d5f 100644
--- a/internal/config.go
+++ b/internal/config.go
@@ -21,9 +21,11 @@ type config struct {
CheckConcurrency int
StaleThreshold int `json:"StaleThreshold,omitempty"`
Federated []string `json:"Federated,omitempty"` // TODO: Document this option
- PrometheusHosts []string `json:"PrometheusHosts,omitempty"`
- PrometheusTimeoutS int `json:"PrometheusTimeoutS,omitempty"`
- Checks map[string]check
+ PrometheusHosts []string `json:"PrometheusHosts,omitempty"`
+ PrometheusTimeoutS int `json:"PrometheusTimeoutS,omitempty"`
+ PrometheusOnlyIfNotExists string `json:"PrometheusOnlyIfNotExists,omitempty"` // Suppress Prometheus alerts if this file exists and is recent
+ PrometheusOnlyIfNotExistsMaxS int `json:"PrometheusOnlyIfNotExistsMaxS,omitempty"` // Max age in seconds for suppression file (default 86400)
+ Checks map[string]check
}
func newConfig(configFile string) (config, error) {
@@ -67,6 +69,10 @@ func newConfig(configFile string) (config, error) {
conf.PrometheusTimeoutS = 2 // Default to 2 seconds
}
+ if conf.PrometheusOnlyIfNotExistsMaxS == 0 {
+ conf.PrometheusOnlyIfNotExistsMaxS = 86400 // Default to 24 hours
+ }
+
if !conf.HTMLDisable && conf.HTMLStatusFile == "" {
conf.HTMLStatusFile = "/var/www/htdocs/buetow.org/self/gogios/index.html"
log.Println("Set HTMLStatusFile to " + conf.HTMLStatusFile)