Disable stock alarms (#10617)
Bring new option to disable stock alarms when it is necessary
thiagoftsm committed
Feb 11, 2021 at 12:45 UTC
fb2d4be0f2f54f541f797fe2d1ce958f81ab1120
2 files changed
+9
-1
health/health_config.c
+8
@@ -1023,5 +1023,13 @@ void health_readdir(RRDHOST *host, const char *user_path, const char *stock_path
1023
return;
1024
}
1025
1026
+ int stock_enabled = (int)config_get_boolean(CONFIG_SECTION_HEALTH, "enable stock health configuration",
1027
+ CONFIG_BOOLEAN_YES);
1028
+
1029
+ if (!stock_enabled) {
1030
+ info("Netdata will not load stock alarms.");
1031
+ stock_path = user_path;
1032
+ }
1033
+
1034
recursive_config_double_dir_load(user_path, stock_path, subpath, health_readfile, (void *) host, 0);
1035
}
libnetdata/libnetdata.c
+1
-1
@@ -1406,7 +1406,7 @@ void recursive_config_double_dir_load(const char *user_path, const char *stock_p
1406
if (!dir) {
1407
error("CONFIG cannot open stock config directory '%s'.", sdir);
1408
}
1409
- else {
1409
+ else if (strcmp(udir, sdir)) {
1410
struct dirent *de = NULL;
1411
while((de = readdir(dir))) {
1412
if(de->d_type == DT_DIR || de->d_type == DT_LNK) {