]> arthur.barton.de Git - netdata.git/blobdiff - src/health.c
draft implementation of netdata central push server - untested
[netdata.git] / src / health.c
index e3ded3195425e394d934579d319c599590c724ab..7dbf7292c13c886b4e9da97314c7fa5fd3c1ef66 100644 (file)
@@ -1,7 +1,7 @@
 #define NETDATA_HEALTH_INTERNALS
 #include "common.h"
 
-int default_localhost_health_enabled = 1;
+int default_health_enabled = 1;
 
 // ----------------------------------------------------------------------------
 // health initialization
@@ -15,9 +15,16 @@ inline char *health_config_dir(void) {
 void health_init(void) {
     debug(D_HEALTH, "Health configuration initializing");
 
-    if(!(default_localhost_health_enabled = config_get_boolean("health", "enabled", 1))) {
-        debug(D_HEALTH, "Health is disabled.");
-        return;
+    if(!central_netdata_to_push_data) {
+        if(!(default_health_enabled = config_get_boolean("health", "enabled", 1))) {
+            debug(D_HEALTH, "Health is disabled.");
+            return;
+        }
+    }
+    else {
+        info("Health is disabled - setup alarms at the central netdata.");
+        config_set_boolean("health", "enabled", 0);
+        default_health_enabled = 0;
     }
 
     char pathname[FILENAME_MAX + 1];