prevent sending CLEAR notifications for cancelled alarms
Costa Tsaousis (ktsaou) committed
Sep 16, 2016 at 21:34 UTC
d28db39a0ec955e6d70a650ab1d8247208bf962f
1 file changed
+3
-2
src/health.c
+3
-2
@@ -2032,7 +2032,7 @@ static inline void health_alarm_execute(RRDHOST *host, ALARM_ENTRY *ae) {
2032
// find the previous notification for the same alarm
2033
ALARM_ENTRY *t;
2034
for(t = ae->next; t ;t = t->next) {
2035
- if(t->alarm_id == ae->alarm_id && t->notifications & HEALTH_ENTRY_NOTIFICATIONS_PROCESSED)
2035
+ if(t->alarm_id == ae->alarm_id && t->notifications & HEALTH_ENTRY_NOTIFICATIONS_EXEC_RUN)
2036
break;
2037
}
2038
@@ -2042,7 +2042,8 @@ static inline void health_alarm_execute(RRDHOST *host, ALARM_ENTRY *ae) {
2042
return;
2043
}
2044
2045
- if(ae->old_status == RRDCALC_STATUS_UNINITIALIZED && ae->new_status == RRDCALC_STATUS_CLEAR) {
2045
+ if(ae->old_status == RRDCALC_STATUS_UNDEFINED && ae->new_status == RRDCALC_STATUS_UNINITIALIZED
2046
+ || ae->old_status == RRDCALC_STATUS_UNINITIALIZED && ae->new_status == RRDCALC_STATUS_CLEAR) {
2047
info("Health not sending notification for first initialization of alarm '%s.%s' status %s", ae->chart, ae->name, rrdcalc_status2string(ae->new_status));
2048
return;
2049
}