@cryptotaxi247 / netdata-1 / commits / b317b2cac

added debug statements when loading health config files (#4896)

Costa Tsaousis committed Dec 2, 2018 at 22:04 UTC b317b2cac0f13b590687ff06fc29d5995d086add
2 files changed +6 -1
health/health_config.c
+4 -1
@@ -853,6 +853,9 @@ static int health_readfile(const char *filename, void *data) {
853 }
854
855 void health_readdir(RRDHOST *host, const char *user_path, const char *stock_path, const char *subpath) {
856 - if(unlikely(!host->health_enabled)) return;
856 + if(unlikely(!host->health_enabled)) {
857 + debug(D_HEALTH, "CONFIG health is not enabled for host '%s'", host->hostname);
858 + return;
859 + }
860 recursive_config_double_dir_load(user_path, stock_path, subpath, health_readfile, (void *) host, 0);
861 }
libnetdata/libnetdata.c
+2
@@ -1386,6 +1386,7 @@ void recursive_config_double_dir_load(const char *user_path, const char *stock_p
1386 if(path_is_file(udir, de->d_name) &&
1387 len > 5 && !strcmp(&de->d_name[len - 5], ".conf")) {
1388 char *filename = strdupz_path_subpath(udir, de->d_name);
1389 + debug(D_HEALTH, "CONFIG calling callback for user file '%s'", filename);
1390 callback(filename, data);
1391 freez(filename);
1392 }
@@ -1431,6 +1432,7 @@ void recursive_config_double_dir_load(const char *user_path, const char *stock_p
1432 if(path_is_file(sdir, de->d_name) && !path_is_file(udir, de->d_name) &&
1433 len > 5 && !strcmp(&de->d_name[len - 5], ".conf")) {
1434 char *filename = strdupz_path_subpath(sdir, de->d_name);
1435 + debug(D_HEALTH, "CONFIG calling callback for stock file '%s'", filename);
1436 callback(filename, data);
1437 freez(filename);
1438 }