more tracing info for health
Costa Tsaousis committed
Aug 15, 2016 at 03:01 UTC
b92101d3d3d96557be9eeab2afc1e5051cd88717
2 files changed
+13
-4
conf.d/health.d/disks.conf
+2
-2
@@ -20,7 +20,7 @@ template: low_disk_space
20
21
template: disk_fill_rate_1m
22
on: disk.space
23
- lookup: max -1s at -1m unaligned
23
+ lookup: max -1s at -1m unaligned of avail
24
calc: ($this - $avail) / (1 * 60)
25
every: 1m
26
warn: $this * 2 * 86400 > $avail
@@ -31,7 +31,7 @@ template: disk_fill_rate_1m
31
# during the last hour
32
template: disk_fill_rate_59m
33
on: disk.space
34
- lookup: max -1s at -59m unaligned
34
+ lookup: max -1s at -59m unaligned of avail
35
every: 1m
36
calc: ($this - $avail) / (59 * 60)
37
warn: $this * 2 * 86400 > $avail
src/health.c
+11
-2
@@ -1027,6 +1027,8 @@ static inline int health_parse_lookup(
1027
int *group_method, int *after, int *before, int *every,
1028
uint32_t *options, char **dimensions
1029
) {
1030
+ debug(D_HEALTH, "Health configuration parsing database lookup %zu@%s/%s: %s", line, path, file, string);
1031
+
1032
if(*dimensions) freez(*dimensions);
1033
*dimensions = NULL;
1034
*after = 0;
@@ -1113,6 +1115,10 @@ static inline int health_parse_lookup(
1115
*dimensions = strdupz(s);
1116
break;
1117
}
1118
+ else {
1119
+ error("Health configuration at line %zu of file '%s/%s': unknown keyword '%s'",
1120
+ line, path, file, key);
1121
+ }
1122
}
1123
1124
return 1;
@@ -1562,8 +1568,11 @@ void *health_main(void *ptr) {
1568
error("Health for alarm '%s', failed to evaluate calculation with error: %s", rc->name,
1569
buffer_tostring(rc->calculation->error_msg));
1570
} else {
1565
- debug(D_HEALTH, "Health for alarm '%s', calculation gave value "
1566
- CALCULATED_NUMBER_FORMAT, rc->name, rc->calculation->result);
1571
+ debug(D_HEALTH, "Health for alarm '%s', calculation expression gave value "
1572
+ CALCULATED_NUMBER_FORMAT ": %s",
1573
+ rc->name, rc->calculation->result,
1574
+ buffer_tostring(rc->calculation->error_msg)
1575
+ );
1576
rc->value = rc->calculation->result;
1577
}
1578
}