@cryptotaxi247 / netdata-1 / commits / 57cfddf67

each host has its own alarms execution status; fixes #2694

Costa Tsaousis (ktsaou) committed Sep 7, 2017 at 11:02 UTC 57cfddf678e526597da96042df710fd76a66bc8d
2 files changed +3 -3
src/health.c
+2 -3
@@ -204,14 +204,13 @@ static inline void health_process_notifications(RRDHOST *host, ALARM_ENTRY *ae)
204 }
205
206 static inline void health_alarm_log_process(RRDHOST *host) {
207 - static uint32_t stop_at_id = 0;
207 uint32_t first_waiting = (host->health_log.alarms)?host->health_log.alarms->unique_id:0;
208 time_t now = now_realtime_sec();
209
210 netdata_rwlock_rdlock(&host->health_log.alarm_log_rwlock);
211
212 ALARM_ENTRY *ae;
214 - for(ae = host->health_log.alarms; ae && ae->unique_id >= stop_at_id ; ae = ae->next) {
213 + for(ae = host->health_log.alarms; ae && ae->unique_id >= host->health_last_processed_id ; ae = ae->next) {
214 if(unlikely(
215 !(ae->flags & HEALTH_ENTRY_FLAG_PROCESSED) &&
216 !(ae->flags & HEALTH_ENTRY_FLAG_UPDATED)
@@ -226,7 +225,7 @@ static inline void health_alarm_log_process(RRDHOST *host) {
225 }
226
227 // remember this for the next iteration
229 - stop_at_id = first_waiting;
228 + host->health_last_processed_id = first_waiting;
229
230 netdata_rwlock_unlock(&host->health_log.alarm_log_rwlock);
231
src/rrd.h
+1
@@ -462,6 +462,7 @@ struct rrdhost {
462 RRDCALC *alarms;
463
464 ALARM_LOG health_log; // alarms historical events (event log)
465 + uint32_t health_last_processed_id; // the last processed health id from the log
466
467 // templates of alarms
468 // these are used to create alarms when charts