}
+ // ------------------------------------------------------------------------
+ // initialize rrd host
+
+ rrd_init(netdata_configured_hostname);
+
+
// --------------------------------------------------------------------
// find we need to send data to another netdata
registry_init();
- // ------------------------------------------------------------------------
- // initialize rrd host
-
- rrd_init(netdata_configured_hostname);
-
-
if(check_config)
exit(1);
int update_every,
int entries,
RRD_MEMORY_MODE memory_mode,
- int health_enabled) {
+ int health_enabled,
+ int is_localhost
+) {
debug(D_RRDHOST, "Host '%s': adding with guid '%s'", hostname, guid);
char filename[FILENAME_MAX + 1];
- if(!localhost) {
- // this is localhost
+ if(is_localhost) {
host->cache_dir = strdupz(netdata_configured_cache_dir);
host->varlib_dir = strdupz(netdata_configured_varlib_dir);
rrd_wrlock();
- if(localhost) {
- host->next = localhost->next;
- localhost->next = host;
+ if(is_localhost) {
+ host->next = localhost;
+ localhost = host;
+ }
+ else {
+ if(localhost) {
+ host->next = localhost->next;
+ localhost->next = host;
+ }
+ else localhost = host;
}
if(rrdhost_index_add(host) != host)
RRDHOST *host = rrdhost_find(guid, 0);
if(!host) {
- host = rrdhost_create(hostname, guid, os, update_every, history, mode, health_enabled);
+ host = rrdhost_create(hostname, guid, os, update_every, history, mode, health_enabled, 0);
}
else {
host->health_enabled = health_enabled;
default_rrd_update_every,
default_rrd_history_entries,
default_rrd_memory_mode,
- default_health_enabled
+ default_health_enabled,
+ 1
);
}
int rrdpush_receiver_thread_spawn(RRDHOST *host, struct web_client *w, char *url) {
(void)host;
-
+
info("STREAM [receive from [%s]:%s]: new client connection.", w->client_ip, w->client_port);
char *key = NULL, *hostname = NULL, *machine_guid = NULL, *os = NULL;