Allow the REMOVED status to be sent if a previous status was WARN/CRIT (#10533)
Stelios Fragkakis committed
Feb 11, 2021 at 14:26 UTC
b4b6e75dd7bd89253c935bf6cf0539e42ccda7ec
1 file changed
+8
-7
health/health_json.c
+8
-7
@@ -352,14 +352,15 @@ void health_active_log_alarms_2json(RRDHOST *host, BUFFER *wb) {
352
unsigned int count = 0;
353
ALARM_ENTRY *ae;
354
for(ae = host->health_log.alarms; ae && count < max ; ae = ae->next) {
355
-
356
- if(likely(!((ae->new_status == RRDCALC_STATUS_WARNING || ae->new_status == RRDCALC_STATUS_CRITICAL)
357
- && !ae->updated_by_id)))
358
- continue;
359
-
360
- if(likely(count)) buffer_strcat(wb, ",");
355
+ if (!ae->updated_by_id &&
356
+ ((ae->new_status == RRDCALC_STATUS_WARNING || ae->new_status == RRDCALC_STATUS_CRITICAL) ||
357
+ ((ae->old_status == RRDCALC_STATUS_WARNING || ae->old_status == RRDCALC_STATUS_CRITICAL) &&
358
+ ae->new_status == RRDCALC_STATUS_REMOVED))) {
359
+ if (likely(count))
360
+ buffer_strcat(wb, ",");
361
health_alarm_entry2json_nolock(wb, ae, host);
362
- count++;
362
+ count++;
363
+ }
364
}
365
buffer_strcat(wb, "]");
366