{ 'h', "Display this help message.", NULL, NULL},
{ 'P', "File to save a pid while running.", "filename", "do not save pid to a file"},
{ 'i', "The IP address to listen to.", "IP", "all IP addresses IPv4 and IPv6"},
- { 'k', "Check health configuration and exit.", NULL, NULL},
{ 'p', "API/Web port to use.", "port", "19999"},
{ 's', "Prefix for /proc and /sys (for containers).", "path", "no prefix"},
{ 't', "The internal clock of netdata.", "seconds", "1"},
}
int main(int argc, char **argv) {
- int i, check_config = 0;
+ int i;
int config_loaded = 0;
int dont_fork = 0;
size_t wanted_stacksize = 0, stacksize = 0;
case 'i':
config_set(CONFIG_SECTION_API, "bind to", optarg);
break;
- case 'k':
- dont_fork = 1;
- check_config = 1;
- break;
case 'P':
strncpy(pidfile, optarg, FILENAME_MAX);
pidfile[FILENAME_MAX] = '\0';
// get log filenames and settings
log_init();
- if(check_config) {
- stdout_filename = stderr_filename = stdaccess_filename = "system";
- error_log_throttle_period = 0;
- error_log_errors_per_period = 0;
- }
error_log_limit_unlimited();
// --------------------------------------------------------------------
// --------------------------------------------------------------------
// create the listening sockets
- if(!check_config && web_server_mode != WEB_SERVER_MODE_NONE)
+ if(web_server_mode != WEB_SERVER_MODE_NONE)
create_listen_sockets();
// ------------------------------------------------------------------------
- // initialize rrd host
+ // initialize rrd, registry, health, rrdpush, etc.
rrd_init(netdata_configured_hostname);
- // --------------------------------------------------------------------
- // find we need to send data to another netdata
-
- rrdpush_init();
-
-
- // ------------------------------------------------------------------------
- // initialize health monitoring
-
- health_init();
-
-
- // ------------------------------------------------------------------------
- // initialize the registry
-
- registry_init();
-
-
- if(check_config)
- exit(1);
-
-
// ------------------------------------------------------------------------
// enable log flood protection
// RRDHOST global / startup initialization
void rrd_init(char *hostname) {
- debug(D_RRDHOST, "Initializing localhost with hostname '%s'", hostname);
+ health_init();
+ registry_init();
+ debug(D_RRDHOST, "Initializing localhost with hostname '%s'", hostname);
localhost = rrdhost_create(hostname,
registry_get_this_machine_guid(),
os_type,
default_health_enabled,
1
);
+
+ rrdpush_init();
}
// ----------------------------------------------------------------------------