diff options
author | Emmanuel Vasilakis <mrzammler@mm.st> | 2023-07-03 16:40:17 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-03 16:40:17 +0300 |
commit | 6dd2fc735ad37165de442893109cc5a33bc83522 (patch) | |
tree | 65d721f9aa3ca8921563d0c2859346b3e47d9832 /database/sqlite/sqlite_aclk_alert.c | |
parent | 52ac7b0f1a2de17feeb2613d2a32a6aa17429cbc (diff) |
Send alert chart labels config key to cloud (#15283)
* add chart_labels to alert_hash
* store chart_labels in alert_hash
* transmit to cloud
Diffstat (limited to 'database/sqlite/sqlite_aclk_alert.c')
-rw-r--r-- | database/sqlite/sqlite_aclk_alert.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/database/sqlite/sqlite_aclk_alert.c b/database/sqlite/sqlite_aclk_alert.c index 71836d7370..ac84eac206 100644 --- a/database/sqlite/sqlite_aclk_alert.c +++ b/database/sqlite/sqlite_aclk_alert.c @@ -519,7 +519,7 @@ void aclk_send_alarm_configuration(char *config_hash) #define SQL_SELECT_ALERT_CONFIG "SELECT alarm, template, on_key, class, type, component, os, hosts, plugin," \ "module, charts, families, lookup, every, units, green, red, calc, warn, crit, to_key, exec, delay, repeat, info," \ "options, host_labels, p_db_lookup_dimensions, p_db_lookup_method, p_db_lookup_options, p_db_lookup_after," \ - "p_db_lookup_before, p_update_every FROM alert_hash WHERE hash_id = @hash_id;" + "p_db_lookup_before, p_update_every, chart_labels FROM alert_hash WHERE hash_id = @hash_id;" int aclk_push_alert_config_event(char *node_id __maybe_unused, char *config_hash __maybe_unused) { int rc = 0; @@ -620,6 +620,8 @@ int aclk_push_alert_config_event(char *node_id __maybe_unused, char *config_hash alarm_config.p_update_every = sqlite3_column_int(res, 32); + alarm_config.chart_labels = sqlite3_column_bytes(res, 33) > 0 ? strdupz((char *)sqlite3_column_text(res, 33)) : NULL; + p_alarm_config.cfg_hash = strdupz((char *) config_hash); p_alarm_config.cfg = alarm_config; } |