diff options
Diffstat (limited to '')
-rw-r--r-- | health/health_json.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/health/health_json.c b/health/health_json.c index be95100bc..d5285c11e 100644 --- a/health/health_json.c +++ b/health/health_json.c @@ -165,6 +165,10 @@ static inline void health_rrdcalc_values2json_nolock(RRDHOST *host, BUFFER *wb, buffer_rrd_value(wb, rc->value); buffer_strcat(wb, ",\n"); + buffer_strcat(wb, "\t\t\t\"last_updated\":"); + buffer_sprintf(wb, "%lu", (unsigned long)rc->last_updated); + buffer_strcat(wb, ",\n"); + buffer_sprintf(wb, "\t\t\t\"status\": \"%s\"\n" , rrdcalc_status2string(rc->status)); @@ -227,6 +231,7 @@ static inline void health_rrdcalc2json_nolock(RRDHOST *host, BUFFER *wb, RRDCALC "\t\t\t\"crit_repeat_every\": \"%u\",\n" "\t\t\t\"value_string\": \"%s\",\n" "\t\t\t\"last_repeat\": \"%lu\",\n" + "\t\t\t\"times_repeat\": %lu,\n" , rc->chart, rc->name , (unsigned long)rc->id , hash_id @@ -259,6 +264,7 @@ static inline void health_rrdcalc2json_nolock(RRDHOST *host, BUFFER *wb, RRDCALC , rc->crit_repeat_every , value_string , (unsigned long)rc->last_repeat + , (unsigned long)rc->times_repeat ); if(unlikely(rc->options & RRDCALC_FLAG_NO_CLEAR_NOTIFICATION)) { @@ -338,6 +344,8 @@ void health_aggregate_alarms(RRDHOST *host, BUFFER *wb, BUFFER* contexts, RRDCAL for(rc = host->alarms; rc ; rc = rc->next) { if(unlikely(!rc->rrdset || !rc->rrdset->last_collected_time.tv_sec)) continue; + if (unlikely(!rrdset_is_available_for_exporting_and_alarms(rc->rrdset))) + continue; if(unlikely(rc->rrdset && rc->rrdset->hash_context == simple_hash(tok) && !strcmp(rc->rrdset->context, tok) && ((status==RRDCALC_STATUS_RAISED)?(rc->status >= RRDCALC_STATUS_WARNING):rc->status == status))) @@ -349,7 +357,8 @@ void health_aggregate_alarms(RRDHOST *host, BUFFER *wb, BUFFER* contexts, RRDCAL for(rc = host->alarms; rc ; rc = rc->next) { if(unlikely(!rc->rrdset || !rc->rrdset->last_collected_time.tv_sec)) continue; - + if (unlikely(!rrdset_is_available_for_exporting_and_alarms(rc->rrdset))) + continue; if(unlikely((status==RRDCALC_STATUS_RAISED)?(rc->status >= RRDCALC_STATUS_WARNING):rc->status == status)) numberOfAlarms++; } |