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_health.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_health.c')
-rw-r--r-- | database/sqlite/sqlite_health.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/database/sqlite/sqlite_health.c b/database/sqlite/sqlite_health.c index 1226b9209e..82924a16af 100644 --- a/database/sqlite/sqlite_health.c +++ b/database/sqlite/sqlite_health.c @@ -975,8 +975,8 @@ void sql_health_alarm_log_load(RRDHOST *host) { "on_key, class, component, type, os, hosts, lookup, every, units, calc, families, plugin, module, " \ "charts, green, red, warn, crit, exec, to_key, info, delay, options, repeat, 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, source) values (?1,unixepoch(),?2,?3,?4,?5,?6,?7,?8,?9,?10,?11,?12," \ - "?13,?14,?15,?16,?17,?18,?19,?20,?21,?22,?23,?24,?25,?26,?27,?28,?29,?30,?31,?32,?33,?34,?35);" + "p_db_lookup_before, p_update_every, source, chart_labels) values (?1,unixepoch(),?2,?3,?4,?5,?6,?7,?8,?9,?10,?11,?12," \ + "?13,?14,?15,?16,?17,?18,?19,?20,?21,?22,?23,?24,?25,?26,?27,?28,?29,?30,?31,?32,?33,?34,?35,?36);" int sql_store_alert_config_hash(uuid_t *hash_id, struct alert_config *cfg) { @@ -1160,6 +1160,10 @@ int sql_store_alert_config_hash(uuid_t *hash_id, struct alert_config *cfg) if (unlikely(rc != SQLITE_OK)) goto bind_fail; + rc = sqlite3_bind_string_or_null(res, cfg->chart_labels, ++param); + if (unlikely(rc != SQLITE_OK)) + goto bind_fail; + rc = execute_insert(res); if (unlikely(rc != SQLITE_DONE)) error_report("Failed to store alert config, rc = %d", rc); |