@cryptotaxi247 / netdata-1 / commits / d2c73227a

check that alarms have update frequency

Costa Tsaousis committed Aug 20, 2016 at 22:05 UTC d2c73227ae5fbff38e478530033e12e6d25bb4f2
1 file changed +10
src/health.c
+10
@@ -755,6 +755,11 @@ static inline int rrdcalc_add_alarm_from_config(RRDHOST *host, RRDCALC *rc) {
755 return 0;
756 }
757
758 + if(!rc->update_every) {
759 + error("Health configuration for alarm '%s.%s' has no frequency (parameter 'every'). Ignoring it.", rc->chart?rc->chart:"NOCHART", rc->name);
760 + return 0;
761 + }
762 +
763 if(!RRDCALC_HAS_DB_LOOKUP(rc) && !rc->warning && !rc->critical) {
764 error("Health configuration for alarm '%s.%s' is useless (no calculation, no warning and no critical evaluation)", rc->chart?rc->chart:"NOCHART", rc->name);
765 return 0;
@@ -788,6 +793,11 @@ static inline int rrdcalctemplate_add_template_from_config(RRDHOST *host, RRDCAL
793 return 0;
794 }
795
796 + if(!rt->update_every) {
797 + error("Health configuration for template '%s' has no frequency (parameter 'every'). Ignoring it.", rt->name);
798 + return 0;
799 + }
800 +
801 if(!RRDCALCTEMPLATE_HAS_CALCULATION(rt) && !rt->warning && !rt->critical) {
802 error("Health configuration for template '%s' is useless (no calculation, no warning and no critical evaluation)", rt->name);
803 return 0;