@cryptotaxi247 / netdata-1 / commits / 1dd38953d

added more debug info in health monitoring

Costa Tsaousis (ktsaou) committed Sep 7, 2016 at 21:07 UTC 1dd38953dbedcf2adb642774d4e448d4dd1985d4
1 file changed +6 -1
src/health.c
+6 -1
@@ -503,6 +503,7 @@ inline void rrdsetcalc_unlink(RRDCALC *rc) {
503 RRDSET *st = rc->rrdset;
504
505 if(!st) {
506 + debug(D_HEALTH, "Requested to unlink RRDCALC '%s.%s' which is not linked to any RRDSET", rc->chart?rc->chart:"NOCHART", rc->name);
507 error("Requested to unlink RRDCALC '%s.%s' which is not linked to any RRDSET", rc->chart?rc->chart:"NOCHART", rc->name);
508 return;
509 }
@@ -560,6 +561,7 @@ static inline int rrdcalc_exists(RRDHOST *host, const char *name, uint32_t hash)
561 // make sure it does not already exist
562 for(rc = host->alarms; rc ; rc = rc->next) {
563 if (unlikely(rc->hash == hash && !strcmp(name, rc->name))) {
564 + debug(D_HEALTH, "Health alarm '%s' already exists in host '%s'.", name, host->hostname);
565 error("Health alarm '%s' already exists in host '%s'.", name, host->hostname);
566 return 1;
567 }
@@ -626,6 +628,8 @@ static inline RRDCALC *rrdcalc_create(RRDHOST *host, const char *name, const cha
628 const char *exec, const char *recipient, const char *source,
629 const char *calc, const char *warn, const char *crit) {
630
631 + debug(D_HEALTH, "Health creating dynamic alarm (from template) '%s.%s'", chart, name);
632 +
633 char fullname[RRDVAR_MAX_LENGTH + 1];
634 uint32_t hash = rrdcalc_fullname(fullname, RRDVAR_MAX_LENGTH + 1, chart, name);
635
@@ -1460,9 +1464,10 @@ void health_readdir(const char *path) {
1464 && (
1465 (de->d_name[0] == '.' && de->d_name[1] == '\0')
1466 || (de->d_name[0] == '.' && de->d_name[1] == '.' && de->d_name[2] == '\0')
1463 - ))
1467 + )) {
1468 debug(D_HEALTH, "Ignoring directory '%s'", de->d_name);
1469 continue;
1470 + }
1471
1472 else if(de->d_type == DT_DIR) {
1473 char *s = mallocz(pathlen + strlen(de->d_name) + 2);