diff options
author | Emmanuel Vasilakis <mrzammler@mm.st> | 2022-12-19 13:52:37 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-12-19 13:52:37 +0200 |
commit | e6c04cb4de6387c7ba1dbf80076ca4bd7578237b (patch) | |
tree | 31feca5e2dd311c2194b35c3f0275cf00995487f /health/health.c | |
parent | ccfda8fa501f8e77e5b7036dd0ed71fef4e8c2a4 (diff) |
Add a health configuration option of what alarms to load (#14150)
* use a simple pattern to choose what alerts to load
* rename config to alarms
* add config entry doc
* fix link
* change wording
* change wording 2
* add to analytics
* build a list of disabled alarms for analytics
* add silenced alarms
* remove analytics related
* remove analytics related 2
Diffstat (limited to 'health/health.c')
-rw-r--r-- | health/health.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/health/health.c b/health/health.c index 096eedec4a..03cfd51447 100644 --- a/health/health.c +++ b/health/health.c @@ -159,6 +159,7 @@ static bool prepare_command(BUFFER *wb, unsigned int default_health_enabled = 1; char *silencers_filename; +SIMPLE_PATTERN *conf_enabled_alarms = NULL; // the queue of executed alarm notifications that haven't been waited for yet static __thread struct { @@ -769,6 +770,8 @@ static void initialize_health(RRDHOST *host, int is_localhost) { else host->health_log.max = (unsigned int)n; + conf_enabled_alarms = simple_pattern_create(config_get(CONFIG_SECTION_HEALTH, "enabled alarms", "*"), NULL, SIMPLE_PATTERN_EXACT); + netdata_rwlock_init(&host->health_log.alarm_log_rwlock); char filename[FILENAME_MAX + 1]; @@ -1553,7 +1556,6 @@ void *health_main(void *ptr) { void health_add_host_labels(void) { DICTIONARY *labels = localhost->rrdlabels; - enum rrdlabel_source src; // The source should be CONF, but when it is set, these labels are exported by default ('send configured labels' in exporting.conf). // Their export seems to break exporting to Graphite, see https://github.com/netdata/netdata/issues/14084. |