From 970987c0d6e99ef0db866a09396d5613042a94d1 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Thu, 18 Feb 2021 16:22:14 +0100 Subject: Merging upstream version 1.29.2. Signed-off-by: Daniel Baumann --- health/health_json.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'health/health_json.c') diff --git a/health/health_json.c b/health/health_json.c index d068b5427..7b5a1e3cb 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, "]"); -- cgit v1.2.3