add debug server with status page
diff --git a/main.go b/main.go
index b97e171..5802ee1 100644
--- a/main.go
+++ b/main.go
@@ -18,6 +18,7 @@
flagConfigPath string
flagNetboxHost string
flagNetboxAPIKey string
+ flagDebugListen string
)
func init() {
@@ -28,6 +29,7 @@
flag.StringVar(&flagConfigPath, "config_path", "./topo.pb.text", "Text proto configuration of Topo (per config.proto)")
flag.StringVar(&flagNetboxHost, "netbox_host", "netbox.bgp.wtf", "Netbox host")
flag.StringVar(&flagNetboxAPIKey, "netbox_api_key", "", "Netbox API key")
+ flag.StringVar(&flagDebugListen, "debug_listen", "127.0.0.1:42001", "Debug HTTP listen address")
flag.Parse()
ctx := context.Background()
@@ -52,4 +54,10 @@
if err != nil {
glog.Exitf("Initial netbox feed failed: %v", err)
}
+
+ sconf := ServiceConfig{
+ DebugListen: flagDebugListen,
+ }
+ srv := NewService(gr, sconf)
+ srv.Run()
}