Adjust alarms count (#12896)
* check for is_available when counting * remove empty line
Emmanuel Vasilakis committed
May 17, 2022 at 12:00 UTC
6c6997da0952f6d87806132322a84483816e15f1
1 file changed
+4
-1
health/health_json.c
+4
-1
@@ -340,6 +340,8 @@ void health_aggregate_alarms(RRDHOST *host, BUFFER *wb, BUFFER* contexts, RRDCAL
340
for(rc = host->alarms; rc ; rc = rc->next) {
341
if(unlikely(!rc->rrdset || !rc->rrdset->last_collected_time.tv_sec))
342
continue;
343
+ if (unlikely(!rrdset_is_available_for_exporting_and_alarms(rc->rrdset)))
344
+ continue;
345
if(unlikely(rc->rrdset && rc->rrdset->hash_context == simple_hash(tok)
346
&& !strcmp(rc->rrdset->context, tok)
347
&& ((status==RRDCALC_STATUS_RAISED)?(rc->status >= RRDCALC_STATUS_WARNING):rc->status == status)))
@@ -351,7 +353,8 @@ void health_aggregate_alarms(RRDHOST *host, BUFFER *wb, BUFFER* contexts, RRDCAL
353
for(rc = host->alarms; rc ; rc = rc->next) {
354
if(unlikely(!rc->rrdset || !rc->rrdset->last_collected_time.tv_sec))
355
continue;
354
-
356
+ if (unlikely(!rrdset_is_available_for_exporting_and_alarms(rc->rrdset)))
357
+ continue;
358
if(unlikely((status==RRDCALC_STATUS_RAISED)?(rc->status >= RRDCALC_STATUS_WARNING):rc->status == status))
359
numberOfAlarms++;
360
}