diff options
author | Emmanuel Vasilakis <mrzammler@mm.st> | 2023-07-12 11:24:16 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-12 11:24:16 +0300 |
commit | 38b38993a6547aa33a0591a7ce3e7461c197e893 (patch) | |
tree | 76d483877e6770f11f429d14a49f21af51503d39 /streaming/receiver.c | |
parent | b1bb7bd449af0567e2edabcefd325fffaea0a3fe (diff) |
Keep health log history in seconds (#15314)
* rebase
* changes queries to delete based on when
* readme changes
* no need to do migration
* wip, protect un-updated events from cleanup
* remove index on when_key
* fix query for claimed cleanup
* if set less than minimum, set minimum
* fix query
* correct config assign
Diffstat (limited to 'streaming/receiver.c')
-rw-r--r-- | streaming/receiver.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/streaming/receiver.c b/streaming/receiver.c index 2a81b824c9..c827ca7a1d 100644 --- a/streaming/receiver.c +++ b/streaming/receiver.c @@ -411,6 +411,8 @@ static bool rrdhost_set_receiver(RRDHOST *host, struct receiver_state *rpt) { } } + host->health_log.health_log_history = rpt->config.alarms_history; + // this is a test // if(rpt->hops <= host->sender->hops) // rrdpush_sender_thread_stop(host, "HOPS MISMATCH", false); @@ -552,6 +554,7 @@ static void rrdpush_receive(struct receiver_state *rpt) rpt->config.health_enabled = (int)default_health_enabled; rpt->config.alarms_delay = 60; + rpt->config.alarms_history = HEALTH_LOG_DEFAULT_HISTORY; rpt->config.rrdpush_enabled = (int)default_rrdpush_enabled; rpt->config.rrdpush_destination = default_rrdpush_destination; @@ -588,6 +591,9 @@ static void rrdpush_receive(struct receiver_state *rpt) rpt->config.alarms_delay = appconfig_get_number(&stream_config, rpt->key, "default postpone alarms on connect seconds", rpt->config.alarms_delay); rpt->config.alarms_delay = appconfig_get_number(&stream_config, rpt->machine_guid, "postpone alarms on connect seconds", rpt->config.alarms_delay); + rpt->config.alarms_history = appconfig_get_number(&stream_config, rpt->key, "default health log history", rpt->config.alarms_history); + rpt->config.alarms_history = appconfig_get_number(&stream_config, rpt->machine_guid, "health log history", rpt->config.alarms_history); + rpt->config.rrdpush_enabled = appconfig_get_boolean(&stream_config, rpt->key, "default proxy enabled", rpt->config.rrdpush_enabled); rpt->config.rrdpush_enabled = appconfig_get_boolean(&stream_config, rpt->machine_guid, "proxy enabled", rpt->config.rrdpush_enabled); |