]> arthur.barton.de Git - netdata.git/commitdiff
check that alarms have update frequency
authorCosta Tsaousis <costa@tsaousis.gr>
Sat, 20 Aug 2016 19:05:19 +0000 (22:05 +0300)
committerCosta Tsaousis <costa@tsaousis.gr>
Sat, 20 Aug 2016 19:05:19 +0000 (22:05 +0300)
src/health.c

index 3a4932ae5de9edc8bb7f0efa9ff8251315e04807..abe15d97f95e057e1bc99674f65a50c2804b9abb 100644 (file)
@@ -755,6 +755,11 @@ static inline int rrdcalc_add_alarm_from_config(RRDHOST *host, RRDCALC *rc) {
         return 0;
     }
 
+    if(!rc->update_every) {
+        error("Health configuration for alarm '%s.%s' has no frequency (parameter 'every'). Ignoring it.", rc->chart?rc->chart:"NOCHART", rc->name);
+        return 0;
+    }
+
     if(!RRDCALC_HAS_DB_LOOKUP(rc) && !rc->warning && !rc->critical) {
         error("Health configuration for alarm '%s.%s' is useless (no calculation, no warning and no critical evaluation)", rc->chart?rc->chart:"NOCHART", rc->name);
         return 0;
@@ -788,6 +793,11 @@ static inline int rrdcalctemplate_add_template_from_config(RRDHOST *host, RRDCAL
         return 0;
     }
 
+    if(!rt->update_every) {
+        error("Health configuration for template '%s' has no frequency (parameter 'every'). Ignoring it.", rt->name);
+        return 0;
+    }
+
     if(!RRDCALCTEMPLATE_HAS_CALCULATION(rt) && !rt->warning && !rt->critical) {
         error("Health configuration for template '%s' is useless (no calculation, no warning and no critical evaluation)", rt->name);
         return 0;