]> arthur.barton.de Git - netdata.git/commitdiff
Command line options: add -i (bind to IP address)
authorSimon Nagl <simonnagl@aim.com>
Mon, 23 May 2016 20:20:21 +0000 (22:20 +0200)
committerSimon Nagl <simonnagl@aim.com>
Mon, 23 May 2016 20:20:21 +0000 (22:20 +0200)
Fixes #380

src/main.c

index 569a15b27f37d94651cf4ad8097444c80ca9b35f..71f6ea964bc3f89eb54a6465731601bbdafab452 100644 (file)
@@ -196,6 +196,7 @@ struct option_def options[] = {
        {'D', "Disable fork into background",                                    NULL,                                   NULL},
        {'h', "Display help message",                                            NULL,                                   NULL},
        {'P', "File to save a pid while running",                                "FILE",                                 NULL},
+       {'i', "The IP address to listen to.",                                    "address",                              "All addresses"},
        {'p', "Port to listen. Can be from 1 to 65535.",                         "port_number",                          "19999"},
        {'s', "Path to access host /proc and /sys when running in a container.", "PATH",                                 NULL},
        {'t', "The frequency in seconds, for data collection. \
@@ -332,6 +333,9 @@ int main(int argc, char **argv)
                                case 'h':
                                        help(0);
                                        break;
+                               case 'i':
+                                       config_set("global", "bind socket to IP", optarg);
+                                       break;
                                case 'P':
                                        strncpy(pidfile, optarg, FILENAME_MAX);
                                        pidfile[FILENAME_MAX] = '\0';