diff options
author | Stelios Fragkakis <52996999+stelfrag@users.noreply.github.com> | 2023-02-22 20:58:29 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-02-22 20:58:29 +0200 |
commit | 37ba7d615d458a5246a93e8ad0e67294500d538c (patch) | |
tree | e47097fceafc4a97c7f42567ca7732c4efa24306 /health/health.c | |
parent | 56f522ad1ca3b86c14d7e800e5ad7e63ca95c5d7 (diff) |
Clean host structure (#14584)
* Remove varlib_dir from host structure
* Remove unused parameter
Diffstat (limited to 'health/health.c')
-rw-r--r-- | health/health.c | 18 |
1 files changed, 3 insertions, 15 deletions
diff --git a/health/health.c b/health/health.c index e333dfe905..1e20b51b70 100644 --- a/health/health.c +++ b/health/health.c @@ -753,7 +753,8 @@ static void health_main_cleanup(void *ptr) { log_health("Health thread ended."); } -static void initialize_health(RRDHOST *host, int is_localhost) { +static void initialize_health(RRDHOST *host) +{ if(!host->health.health_enabled || rrdhost_flag_check(host, RRDHOST_FLAG_INITIALIZED_HEALTH) || !service_running(SERVICE_HEALTH)) @@ -786,19 +787,6 @@ static void initialize_health(RRDHOST *host, int is_localhost) { char filename[FILENAME_MAX + 1]; - if(!is_localhost) { - int r = mkdir(host->varlib_dir, 0775); - if (r != 0 && errno != EEXIST) - error("Host '%s': cannot create directory '%s'", rrdhost_hostname(host), host->varlib_dir); - } - - { - snprintfz(filename, FILENAME_MAX, "%s/health", host->varlib_dir); - int r = mkdir(filename, 0775); - if(r != 0 && errno != EEXIST) - error("Host '%s': cannot create directory '%s'", rrdhost_hostname(host), filename); - } - snprintfz(filename, FILENAME_MAX, "%s/alarm-notify.sh", netdata_configured_primary_plugins_dir); host->health.health_default_exec = string_strdupz(config_get(CONFIG_SECTION_HEALTH, "script to execute on alarm", filename)); host->health.health_default_recipient = string_strdupz("root"); @@ -1039,7 +1027,7 @@ void *health_main(void *ptr) { if (unlikely(!rrdhost_flag_check(host, RRDHOST_FLAG_INITIALIZED_HEALTH))) { rrd_unlock(); - initialize_health(host, host == localhost); + initialize_health(host); rrd_rdlock(); } |