From b92101d3d3d96557be9eeab2afc1e5051cd88717 Mon Sep 17 00:00:00 2001 From: Costa Tsaousis Date: Mon, 15 Aug 2016 03:01:09 +0300 Subject: [PATCH] more tracing info for health --- conf.d/health.d/disks.conf | 4 ++-- src/health.c | 13 +++++++++++-- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/conf.d/health.d/disks.conf b/conf.d/health.d/disks.conf index 3f300cd6..4f66f92f 100644 --- a/conf.d/health.d/disks.conf +++ b/conf.d/health.d/disks.conf @@ -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 diff --git a/src/health.c b/src/health.c index bc09c944..ed0cdfc6 100644 --- a/src/health.c +++ b/src/health.c @@ -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; } } -- 2.39.2