]> arthur.barton.de Git - netdata.git/commitdiff
prevent sending CLEAR notifications for cancelled alarms
authorCosta Tsaousis (ktsaou) <costa@tsaousis.gr>
Fri, 16 Sep 2016 18:34:17 +0000 (21:34 +0300)
committerCosta Tsaousis (ktsaou) <costa@tsaousis.gr>
Fri, 16 Sep 2016 18:34:17 +0000 (21:34 +0300)
src/health.c

index 49dc392041eac47f3c8e1ee87b36eeb4df6a02b0..839a285d25f1c27e9bece65c8d7a6b8b167e6aaf 100644 (file)
@@ -2032,7 +2032,7 @@ static inline void health_alarm_execute(RRDHOST *host, ALARM_ENTRY *ae) {
     // find the previous notification for the same alarm
     ALARM_ENTRY *t;
     for(t = ae->next; t ;t = t->next) {
-        if(t->alarm_id == ae->alarm_id && t->notifications & HEALTH_ENTRY_NOTIFICATIONS_PROCESSED)
+        if(t->alarm_id == ae->alarm_id && t->notifications & HEALTH_ENTRY_NOTIFICATIONS_EXEC_RUN)
             break;
     }
 
@@ -2042,7 +2042,8 @@ static inline void health_alarm_execute(RRDHOST *host, ALARM_ENTRY *ae) {
         return;
     }
 
-    if(ae->old_status == RRDCALC_STATUS_UNINITIALIZED && ae->new_status == RRDCALC_STATUS_CLEAR) {
+    if(ae->old_status == RRDCALC_STATUS_UNDEFINED && ae->new_status == RRDCALC_STATUS_UNINITIALIZED
+        || ae->old_status == RRDCALC_STATUS_UNINITIALIZED && ae->new_status == RRDCALC_STATUS_CLEAR) {
         info("Health not sending notification for first initialization of alarm '%s.%s' status %s", ae->chart, ae->name, rrdcalc_status2string(ae->new_status));
         return;
     }