diff options
-rw-r--r-- | health/health_config.c | 8 | ||||
-rw-r--r-- | libnetdata/libnetdata.c | 2 |
2 files changed, 9 insertions, 1 deletions
diff --git a/health/health_config.c b/health/health_config.c index a200a0dbf8..1acf369335 100644 --- a/health/health_config.c +++ b/health/health_config.c @@ -1023,5 +1023,13 @@ void health_readdir(RRDHOST *host, const char *user_path, const char *stock_path return; } + int stock_enabled = (int)config_get_boolean(CONFIG_SECTION_HEALTH, "enable stock health configuration", + CONFIG_BOOLEAN_YES); + + if (!stock_enabled) { + info("Netdata will not load stock alarms."); + stock_path = user_path; + } + recursive_config_double_dir_load(user_path, stock_path, subpath, health_readfile, (void *) host, 0); } diff --git a/libnetdata/libnetdata.c b/libnetdata/libnetdata.c index c9b7ab1983..325df3f765 100644 --- a/libnetdata/libnetdata.c +++ b/libnetdata/libnetdata.c @@ -1406,7 +1406,7 @@ void recursive_config_double_dir_load(const char *user_path, const char *stock_p if (!dir) { error("CONFIG cannot open stock config directory '%s'.", sdir); } - else { + else if (strcmp(udir, sdir)) { struct dirent *de = NULL; while((de = readdir(dir))) { if(de->d_type == DT_DIR || de->d_type == DT_LNK) { |