diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2021-02-18 15:22:04 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2021-02-18 15:22:04 +0000 |
commit | 608af7bf0232448f73e76e62a75c8a2e77655101 (patch) | |
tree | 65ff9e4da7675e8713b7fb149f674ffe1a8742d1 /health/health_json.c | |
parent | Adding upstream version 1.29.1. (diff) | |
download | netdata-608af7bf0232448f73e76e62a75c8a2e77655101.tar.xz netdata-608af7bf0232448f73e76e62a75c8a2e77655101.zip |
Adding upstream version 1.29.2.upstream/1.29.2
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'health/health_json.c')
-rw-r--r-- | health/health_json.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/health/health_json.c b/health/health_json.c index d068b542..7b5a1e3c 100644 --- a/health/health_json.c +++ b/health/health_json.c @@ -352,14 +352,15 @@ void health_active_log_alarms_2json(RRDHOST *host, BUFFER *wb) { unsigned int count = 0; ALARM_ENTRY *ae; for(ae = host->health_log.alarms; ae && count < max ; ae = ae->next) { - - if(likely(!((ae->new_status == RRDCALC_STATUS_WARNING || ae->new_status == RRDCALC_STATUS_CRITICAL) - && !ae->updated_by_id))) - continue; - - if(likely(count)) buffer_strcat(wb, ","); + if (!ae->updated_by_id && + ((ae->new_status == RRDCALC_STATUS_WARNING || ae->new_status == RRDCALC_STATUS_CRITICAL) || + ((ae->old_status == RRDCALC_STATUS_WARNING || ae->old_status == RRDCALC_STATUS_CRITICAL) && + ae->new_status == RRDCALC_STATUS_REMOVED))) { + if (likely(count)) + buffer_strcat(wb, ","); health_alarm_entry2json_nolock(wb, ae, host); - count++; + count++; + } } buffer_strcat(wb, "]"); |