]> arthur.barton.de Git - netdata.git/blobdiff - src/backends.c
detect duplicate hosts
[netdata.git] / src / backends.c
index 300f6ae31492091aa728443ca58329cf0a5e4e83..94e8f5f671802c387d33192f86838ea40df7fe72 100644 (file)
@@ -147,25 +147,20 @@ void *backends_main(void *ptr) {
     // ------------------------------------------------------------------------
     // collect configuration options
 
-    if(central_netdata_to_push_data) {
-        info("Backend is disabled - use the central netdata");
-        goto cleanup;
-    }
-
     struct timeval timeout = {
             .tv_sec = 0,
             .tv_usec = 0
     };
     uint32_t options;
-    int enabled             = config_get_boolean("backend", "enabled", 0);
-    const char *source      = config_get("backend", "data source", "average");
-    const char *type        = config_get("backend", "type", "graphite");
-    const char *destination = config_get("backend", "destination", "localhost");
-    const char *prefix      = config_get("backend", "prefix", "netdata");
-    const char *hostname    = config_get("backend", "hostname", localhost->hostname);
-    int frequency           = (int)config_get_number("backend", "update every", 10);
-    int buffer_on_failures  = (int)config_get_number("backend", "buffer on failures", 10);
-    long timeoutms          = config_get_number("backend", "timeout ms", frequency * 2 * 1000);
+    int enabled             = config_get_boolean(CONFIG_SECTION_BACKEND, "enabled", 0);
+    const char *source      = config_get(CONFIG_SECTION_BACKEND, "data source", "average");
+    const char *type        = config_get(CONFIG_SECTION_BACKEND, "type", "graphite");
+    const char *destination = config_get(CONFIG_SECTION_BACKEND, "destination", "localhost");
+    const char *prefix      = config_get(CONFIG_SECTION_BACKEND, "prefix", "netdata");
+    const char *hostname    = config_get(CONFIG_SECTION_BACKEND, "hostname", localhost->hostname);
+    int frequency           = (int)config_get_number(CONFIG_SECTION_BACKEND, "update every", 10);
+    int buffer_on_failures  = (int)config_get_number(CONFIG_SECTION_BACKEND, "buffer on failures", 10);
+    long timeoutms          = config_get_number(CONFIG_SECTION_BACKEND, "timeout ms", frequency * 2 * 1000);
 
     // ------------------------------------------------------------------------
     // validate configuration options
@@ -312,6 +307,9 @@ void *backends_main(void *ptr) {
         rrd_rdlock();
         RRDHOST *host;
         rrdhost_foreach_read(host) {
+            if(host->rrd_memory_mode == RRD_MEMORY_MODE_NONE)
+                continue;
+
             rrdhost_rdlock(host);
 
             RRDSET *st;
@@ -399,7 +397,7 @@ void *backends_main(void *ptr) {
             usec_t start_ut = now_monotonic_usec();
             size_t reconnects = 0;
 
-            sock = connect_to_one_of(destination, default_port, &timeout, &reconnects);
+            sock = connect_to_one_of(destination, default_port, &timeout, &reconnects, NULL, 0);
 
             chart_backend_reconnects += reconnects;
             chart_backend_latency += now_monotonic_usec() - start_ut;