Add -vppcfg flag to set ifAlias from the 'description' fields in vppcfg.yaml
This commit is contained in:
8
main.go
8
main.go
@ -16,6 +16,7 @@ import (
|
||||
func main() {
|
||||
addr := flag.String("agentx-addr", "localhost:705", "Address to connect to (hostname:port or Unix socket path)")
|
||||
debug := flag.Bool("debug", false, "Enable debug logging")
|
||||
vppcfg := flag.String("vppcfg", "", "VPP configuration YAML file to read interface descriptions from")
|
||||
flag.Parse()
|
||||
|
||||
// Set global debug flag
|
||||
@ -40,6 +41,13 @@ func main() {
|
||||
// Create the interface MIB
|
||||
interfaceMIB := ifmib.NewInterfaceMIB()
|
||||
|
||||
// Load VPP config if specified
|
||||
if *vppcfg != "" {
|
||||
if err := interfaceMIB.LoadVPPConfig(*vppcfg); err != nil {
|
||||
log.Fatalf("Failed to load VPP config: %v", err)
|
||||
}
|
||||
}
|
||||
|
||||
// Register the interface MIB with the AgentX client
|
||||
if err := interfaceMIB.RegisterWithClient(client); err != nil {
|
||||
log.Fatalf("Failed to register interface MIB: %v", err)
|
||||
|
Reference in New Issue
Block a user