diff --git a/cmd/gnmi/gnmi.go b/cmd/gnmi/gnmi.go index fe2ee8a289e53eb5ac6b07fa1479b329110fdb6a..df0a9121d909d03d2fe65b33f9156ca2bccc2aa7 100644 --- a/cmd/gnmi/gnmi.go +++ b/cmd/gnmi/gnmi.go @@ -29,7 +29,7 @@ func main() { transport := &nucleus.Gnmi{SetNode: sbi.SetNode()} cfg := &gnmi.Config{ - Addr: "localhost:9339", + Addr: "portainer.danet.fbi.h-da.de:6030", Username: "admin", Password: "arista", Encoding: gpb.Encoding_PROTO, @@ -38,7 +38,7 @@ func main() { device.Transport = transport - p := []string{"/interfaces/interface[name=en0]/state/name"} + p := []string{"/interfaces/interface[name=*]/state/name"} errors := 0 for _, path := range p { err := pnd.RequestAll(path) diff --git a/nucleus/gnmi_transport.go b/nucleus/gnmi_transport.go index 2c0ad0c0178cfa816a97a0e4f68852b50182cd7c..ce667b01581027bc1b9ec0f42c2bdaebcbfffbb3 100644 --- a/nucleus/gnmi_transport.go +++ b/nucleus/gnmi_transport.go @@ -115,6 +115,7 @@ func (g *Gnmi) Capabilities(ctx context.Context) (interface{}, error) { // Get calls GNMI get func (g *Gnmi) get(ctx context.Context, paths [][]string, origin string) (interface{}, error) { + ctx = gnmi.NewContext(ctx, g.config) ctx = context.WithValue(ctx, "config", g.config) req, err := gnmi.NewGetRequest(ctx, paths, origin) if err != nil {