summaryrefslogtreecommitdiffstats
path: root/health/health_json.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2021-02-18 15:22:14 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2021-02-18 15:22:14 +0000
commit970987c0d6e99ef0db866a09396d5613042a94d1 (patch)
treeaf21bdbc146083814d19b8d553f15e671ae7fd24 /health/health_json.c
parentReleasing debian version 1.29.1-3. (diff)
downloadnetdata-970987c0d6e99ef0db866a09396d5613042a94d1.tar.xz
netdata-970987c0d6e99ef0db866a09396d5613042a94d1.zip
Merging upstream version 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.c15
1 files changed, 8 insertions, 7 deletions
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, "]");