mirror of
https://github.com/netdata/netdata.git
synced 2025-04-16 18:37:50 +00:00
Add alert version to aclk-state (#19335)
Add current alert version to aclk-state
This commit is contained in:
parent
888c37ca9b
commit
1cb0ce4980
3 changed files with 4 additions and 1 deletions
src
|
@ -1124,6 +1124,8 @@ static void fill_alert_status_for_host_json(json_object *obj, RRDHOST *host)
|
|||
|
||||
tmp = json_object_new_int(wc->snapshot_count);
|
||||
json_object_object_add(obj, "alert-snapshot-count", tmp);
|
||||
tmp = json_object_new_int64(calculate_node_alert_version(wc->host));
|
||||
json_object_object_add(obj, "alert-version", tmp);
|
||||
}
|
||||
|
||||
static json_object *timestamp_to_json(const time_t *t)
|
||||
|
|
|
@ -763,7 +763,7 @@ done:
|
|||
"SELECT SUM(version) FROM health_log hl, alert_version av" \
|
||||
" WHERE hl.host_id = @host_uuid AND hl.health_log_id = av.health_log_id AND av.status <> -2"
|
||||
|
||||
static uint64_t calculate_node_alert_version(RRDHOST *host)
|
||||
uint64_t calculate_node_alert_version(RRDHOST *host)
|
||||
{
|
||||
sqlite3_stmt *res = NULL;
|
||||
|
||||
|
|
|
@ -14,5 +14,6 @@ void send_alert_snapshot_to_cloud(RRDHOST *host __maybe_unused);
|
|||
void aclk_process_send_alarm_snapshot(char *node_id, char *claim_id, char *snapshot_uuid);
|
||||
bool process_alert_pending_queue(RRDHOST *host);
|
||||
void aclk_push_alert_events_for_all_hosts(void);
|
||||
uint64_t calculate_node_alert_version(RRDHOST *host);
|
||||
|
||||
#endif //NETDATA_SQLITE_ACLK_ALERT_H
|
||||
|
|
Loading…
Add table
Reference in a new issue