Skip to content
Snippets Groups Projects
Commit 5805b110 authored by Malte Bauch's avatar Malte Bauch Committed by Malte Bauch
Browse files

Add path and controller flags

parent 5008a952
No related branches found
No related tags found
1 merge request!384Basic interface monitoring application
......@@ -56,7 +56,7 @@ generate-csbi-yang-models: install-tools
../../$(TOOLS_DIR)/go-ygot-generator-generator config.yaml gostructs.go &&\
go generate
build: pre build-gosdn build-gosdnc build-orchestrator build-venv-manager build-arista-routing-engine-app build-hostname-checker-app
build: pre build-gosdn build-gosdnc build-orchestrator build-venv-manager build-arista-routing-engine-app build-hostname-checker-app build-basic-interface-monitoring-app
build-gosdn: pre
$(GOBUILD) -trimpath -o $(BUILD_ARTIFACTS_PATH)/gosdn ./controller/cmd/gosdn
......@@ -76,6 +76,9 @@ build-arista-routing-engine-app: pre
build-hostname-checker-app: pre
$(GOBUILD) -trimpath -o $(BUILD_ARTIFACTS_PATH)/hostname-checker ./applications/hostname-checker
build-basic-interface-monitoring-app: pre
$(GOBUILD) -trimpath -o $(BUILD_ARTIFACTS_PATH)/basic-interface-monitoring ./applications/basic-interface-monitoring
containerize-all: containerize-gosdn containerize-gosdnc containerize-orchestrator containerize-target
containerize-gosdn:
......
......@@ -12,7 +12,7 @@ var clientChannels = make(map[chan []byte]bool)
// StartHTTPServer starts the HTTP server to provide the monitoring page.
func StartHTTPServer() error {
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
http.ServeFile(w, r, "webpage/index.html")
http.ServeFile(w, r, indexPath)
})
http.HandleFunc("/sse", sseHandler)
......
package main
import (
"flag"
"os"
"code.fbi.h-da.de/danet/gosdn/application-framework/event"
......@@ -8,8 +9,16 @@ import (
"github.com/sirupsen/logrus"
)
var controllerAddress string
var indexPath string
func main() {
queueCredentials, err := registration.Register("localhost:55055", "basic-interface-monitoring", "SecurePresharedToken")
flag.StringVar(&indexPath, "path", "webpage/index.html", "path to the webpage index.html file")
flag.StringVar(&controllerAddress, "controller-address", "localhost:55055", "the address to the controller")
flag.Parse()
queueCredentials, err := registration.Register(controllerAddress, "basic-interface-monitoring", "SecurePresharedToken")
if err != nil {
logrus.Errorf("failed to register application on control plane. %v", err)
os.Exit(1)
......@@ -29,5 +38,5 @@ func main() {
stopChannel: make(chan os.Signal, 1),
}
app.Run("localhost:55055")
app.Run(controllerAddress)
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment