0
0
Fork 0
mirror of https://github.com/netdata/netdata.git synced 2025-04-27 22:26:21 +00:00

Disable stock alarms ()

Bring new option to disable stock alarms when it is necessary
This commit is contained in:
thiagoftsm 2021-02-11 12:45:05 +00:00 committed by GitHub
parent b754317628
commit fb2d4be0f2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 1 deletions

View file

@ -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);
}

View file

@ -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) {