summaryrefslogtreecommitdiffstats
path: root/health/health.c
diff options
context:
space:
mode:
authorEmmanuel Vasilakis <mrzammler@mm.st>2023-06-21 15:39:43 +0300
committerGitHub <noreply@github.com>2023-06-21 15:39:43 +0300
commit6e1e97c5e8d136162368e16d27d7aa09b047f8c6 (patch)
tree4d20904c201c87d8a1670a83018aabaf0d4f3398 /health/health.c
parentd8661b8e0ce7648037bfa5dc7f535261d98ac7c9 (diff)
Use a single health log table (#15157)
* move old health log tables to one * change table in sqlite_health * remove check for off period of agent * changes in aclk_alert * fixes * add new field insert_mark_timestamp * cleanup * remove hostname, create the health log table during sqlite init * create the health_log during migration * move source from health_log to alert_hash. Remove class, component and type field from health_log * Register now_usec sqlite function * use global_id instead of insert_mark_timestamp. Use function now_usec to populate it * create functions earlier to have them during migration * small unit test fix * create additional health_log_detail table. Do the insert of an alert event on both * do the update on health_log_detail * change more queries * more indexes, fix inject removed * change last executed and select health log queries * random uuid for sqlite * do migration from old tables * queries to send alerts to cloud * cleanup queries * get an alarm id from db if not found in memory * small fix on query * add info when migration completes * dont pick health_log_detail during migration * check proper old health_log table * safer migration * proper log sent alerts. small fix in claimed cleanup * cleanups * extra check for cleanup * also get an alarm_event_id from sql * check for empty source * remove cleanup of main health log table --------- Co-authored-by: Stelios Fragkakis <52996999+stelfrag@users.noreply.github.com>
Diffstat (limited to 'health/health.c')
-rw-r--r--health/health.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/health/health.c b/health/health.c
index 9d854af2f0..3dd3f96162 100644
--- a/health/health.c
+++ b/health/health.c
@@ -639,7 +639,7 @@ static inline void health_alarm_log_process(RRDHOST *host) {
||
((ae->new_status == RRDCALC_STATUS_REMOVED) &&
(ae->flags & HEALTH_ENTRY_FLAG_SAVED) &&
- (ae->when + 3600 < now_realtime_sec())))
+ (ae->when + 86400 < now_realtime_sec())))
{
if(host->health_log.alarms == ae) {
@@ -794,7 +794,6 @@ static void initialize_health(RRDHOST *host)
// TODO: This needs to go to the metadata thread
// Health should wait before accessing the table (needs to be created by the metadata thread)
- sql_create_health_log_table(host);
sql_health_alarm_log_load(host);
// ------------------------------------------------------------------------