]> arthur.barton.de Git - netdata.git/commitdiff
more tracing info for health
authorCosta Tsaousis <costa@tsaousis.gr>
Mon, 15 Aug 2016 00:01:09 +0000 (03:01 +0300)
committerCosta Tsaousis <costa@tsaousis.gr>
Mon, 15 Aug 2016 00:01:09 +0000 (03:01 +0300)
conf.d/health.d/disks.conf
src/health.c

index 3f300cd6e7ec440d4b90ca240ff4b5e1c33c7836..4f66f92f6414476f09caab3962040a74691e93a2 100644 (file)
@@ -20,7 +20,7 @@ template: low_disk_space
 
 template: disk_fill_rate_1m
       on: disk.space
-  lookup: max -1s at -1m unaligned
+  lookup: max -1s at -1m unaligned of avail
     calc: ($this - $avail) / (1 * 60)
    every: 1m
     warn: $this * 2 * 86400 > $avail
@@ -31,7 +31,7 @@ template: disk_fill_rate_1m
 # during the last hour
 template: disk_fill_rate_59m
       on: disk.space
-  lookup: max -1s at -59m unaligned
+  lookup: max -1s at -59m unaligned of avail
    every: 1m
     calc: ($this - $avail) / (59 * 60)
     warn: $this * 2 * 86400 > $avail
index bc09c9445aa7eacebfa6a827eb003168d30293b5..ed0cdfc68f2ae6765b248cde0004eeed9492d90d 100644 (file)
@@ -1027,6 +1027,8 @@ static inline int health_parse_lookup(
         int *group_method, int *after, int *before, int *every,
         uint32_t *options, char **dimensions
 ) {
+    debug(D_HEALTH, "Health configuration parsing database lookup %zu@%s/%s: %s", line, path, file, string);
+
     if(*dimensions) freez(*dimensions);
     *dimensions = NULL;
     *after = 0;
@@ -1113,6 +1115,10 @@ static inline int health_parse_lookup(
                *dimensions = strdupz(s);
             break;
         }
+        else {
+            error("Health configuration at line %zu of file '%s/%s': unknown keyword '%s'",
+                  line, path, file, key);
+        }
     }
 
     return 1;
@@ -1562,8 +1568,11 @@ void *health_main(void *ptr) {
                                 error("Health for alarm '%s', failed to evaluate calculation with error: %s", rc->name,
                                       buffer_tostring(rc->calculation->error_msg));
                             } else {
-                                debug(D_HEALTH, "Health for alarm '%s', calculation gave value "
-                                        CALCULATED_NUMBER_FORMAT, rc->name, rc->calculation->result);
+                                debug(D_HEALTH, "Health for alarm '%s', calculation expression gave value "
+                                        CALCULATED_NUMBER_FORMAT ": %s",
+                                      rc->name, rc->calculation->result,
+                                      buffer_tostring(rc->calculation->error_msg)
+                                );
                                 rc->value = rc->calculation->result;
                             }
                         }