Skip to content

Commit

Permalink
Make the listen IP address configurable
Browse files Browse the repository at this point in the history
  • Loading branch information
ibuildthecloud committed Nov 12, 2014
1 parent 2020019 commit bed887f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cadvisor.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ import (
"github.com/google/cadvisor/pages/static"
)

var argIp = flag.String("listen_ip", "", "IP to listen on, defaults to all IPs")
var argPort = flag.Int("port", 8080, "port to listen")
var maxProcs = flag.Int("max_procs", 0, "max number of CPUs that can be used simultaneously. Less than 1 for default (number of cores).")

Expand Down Expand Up @@ -105,7 +106,7 @@ func main() {

glog.Infof("Starting cAdvisor version: %q on port %d", info.VERSION, *argPort)

addr := fmt.Sprintf(":%v", *argPort)
addr := fmt.Sprintf("%s:%d", *argIp, *argPort)
glog.Fatal(http.ListenAndServe(addr, nil))
}

Expand Down

0 comments on commit bed887f

Please sign in to comment.