From b87473c481283bbd936661fb15c3bd63fa74dbca Mon Sep 17 00:00:00 2001 From: Emmanuel Vasilakis Date: Sun, 19 Sep 2021 14:11:17 +0300 Subject: Use sqlite to store the health log and alert configurations. (#11399) * Rebased * use sql health log if it exists * store alert config in sqlite * move unlock before loop * fix warnings * remove hash message * check return from counting health log * remove check of hostname when reading log * try to create the health log table to catch accidental removals of it * fix warnings, cast values, report config_hash_id * use snprintfz, add info logging * remove unnecessary strdup and free * check if stored config hash is null * return if prepare statement fails * replace with static variables * remove replace info, free edit_command * remove setting cfg entries to NULL * change uuid_copy * check return of uuid_parse, and exit if its not valid * also free cfg * use address * removed health_alarm_entry_sql2json and sql_health_alarm_log_select_all * remove check for is_valid_alarm_id * replace lengths with GUID_LEN * use uuid_unparse_lower_fix * removed web api endopoint to get alert config * check for non null values for name, chart and family * include a date_updated field in alert_hash * for config hash, digest NULL string if value to digest is null * Use empty string instead of null --- health/health.h | 1 + 1 file changed, 1 insertion(+) (limited to 'health/health.h') diff --git a/health/health.h b/health/health.h index e7408f632d..00629e9821 100644 --- a/health/health.h +++ b/health/health.h @@ -63,6 +63,7 @@ extern ALARM_ENTRY* health_create_alarm_entry( RRDHOST *host, uint32_t alarm_id, uint32_t alarm_event_id, + uuid_t config_hash_id, time_t when, const char *name, const char *chart, -- cgit v1.2.3