]> arthur.barton.de Git - netdata.git/commitdiff
fixed typo the reported all warning alarms as critical and vice versa
authorCosta Tsaousis <costa@tsaousis.gr>
Wed, 17 Aug 2016 21:11:43 +0000 (00:11 +0300)
committerCosta Tsaousis <costa@tsaousis.gr>
Wed, 17 Aug 2016 21:11:43 +0000 (00:11 +0300)
src/health.c

index 36987fef78e986d41626265f0fb2af80868b8202..984816179a97e25d017e4a2cf7dd7ddc2aae28dc 100644 (file)
@@ -1555,31 +1555,31 @@ static inline void health_alarm_log_process(void) {
     }
 }
 
-static inline void rrdcalc_check_critical_event(RRDCALC *rc) {
-    calculated_number n = rc->critical->result;
+static inline void rrdcalc_check_warning_event(RRDCALC *rc) {
+    calculated_number n = rc->warning->result;
 
-    int old_status = rc->critical_status;
+    int old_status = rc->warning_status;
     int new_status = rrdcalc_value2status(n);
 
     if(new_status != old_status) {
         time_t now = time(NULL);
         health_alarm_log(time(NULL), ALARM_ENTRY_TYPE_WARNING, rc->name, rc->rrdset->id, rc->exec, now - rc->last_status_change, rc->old_value, rc->value, old_status, new_status, rc->source);
         rc->last_status_change = now;
-        rc->critical_status = new_status;
+        rc->warning_status = new_status;
     }
 }
 
-static inline void rrdcalc_check_warning_event(RRDCALC *rc) {
-    calculated_number n = rc->warning->result;
+static inline void rrdcalc_check_critical_event(RRDCALC *rc) {
+    calculated_number n = rc->critical->result;
 
-    int old_status = rc->warning_status;
+    int old_status = rc->critical_status;
     int new_status = rrdcalc_value2status(n);
 
     if(new_status != old_status) {
         time_t now = time(NULL);
         health_alarm_log(time(NULL), ALARM_ENTRY_TYPE_CRITICAL, rc->name, rc->rrdset->id, rc->exec, now - rc->last_status_change, rc->old_value, rc->value, old_status, new_status, rc->source);
         rc->last_status_change = now;
-        rc->warning_status = new_status;
+        rc->critical_status = new_status;
     }
 }