Hello, I’m trying to subscribe to a Nokia device (SR OS 21) with proto encoding.
Everything works fine with JSON encoding, but I don’t seem to make the proto encoding work. I guess I’m doing something wrong ?
The configuration is pretty simple :
[[inputs.gnmi]]
addresses = [“ip_address:57400”]
username = “admin”
password = “admin”
redial = “10s”
encoding = “proto”
[[inputs.gnmi.subscription]]
name = “test”
origin = “openconfig”
path = “/interfaces/”
subscription_mode = “sample”
sample_interval = “10s”
As stated earlier, the configuration is working fine if I just replace “encoding = proto” with “encoding = json”.
I understand that I need a yang file so I downloaded them from Github (with the related imports) and put them in my home directory (where is my config file), but it’s not working. I tried to change the “origin” parameter : “openconfig”, “openconfig-interfaces”, “interfaces”, not working.
Any help appreciated, here is how it looks when I run it :
$ telegraf --config tele_nokia.conf --debug
2021-07-30T05:50:43Z I! Starting Telegraf 1.19.2
2021-07-30T05:50:43Z I! Loaded inputs: gnmi
2021-07-30T05:50:43Z I! Loaded aggregators:
2021-07-30T05:50:43Z I! Loaded processors:
2021-07-30T05:50:43Z I! Loaded outputs: file
2021-07-30T05:50:43Z I! Tags enabled: host=hostname
2021-07-30T05:50:43Z I! [agent] Config: Interval:10s, Quiet:false, Hostname:“hostname”, Flush Interval:10s
2021-07-30T05:50:43Z D! [agent] Initializing plugins
2021-07-30T05:50:43Z D! [agent] Connecting outputs
2021-07-30T05:50:43Z D! [agent] Attempting connection to [outputs.file]
2021-07-30T05:50:43Z D! [agent] Successfully connected to outputs.file
2021-07-30T05:50:43Z D! [agent] Starting service inputs
2021-07-30T05:50:43Z D! [inputs.gnmi] Connection to gNMI device ip_address:57400 established
2021-07-30T05:50:53Z D! [outputs.file] Buffer fullness: 0 / 10000 metrics
2021-07-30T05:50:53Z D! [inputs.gnmi] Connection to gNMI device ip_address:57400 closed
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x20 pc=0x168feab]
goroutine 51 [running]:
github .com/influxdata/telegraf/plugins/inputs/gnmi.(*GNMI).handlePath(0xc000878780, 0x0, 0xc000379a48, 0x0, 0x0, 0x30, 0x30, 0x4c97fa0, 0xc000379880, 0x8a73d5, …)
/go/src/github.com/influxdata/telegraf/plugins/inputs/gnmi/gnmi.go:395 +0xab
github .com/influxdata/telegraf/plugins/inputs/gnmi.(*GNMI).handleTelemetryField(0xc000878780, 0xc001280580, 0xc000379a48, 0x0, 0x0, 0x5, 0x0, 0x0)
/go/src/github.com/influxdata/telegraf/plugins/inputs/gnmi/gnmi.go:336 +0x77
github .com/influxdata/telegraf/plugins/inputs/gnmi.(*GNMI).handleSubscribeResponseUpdate(0xc000878780, 0xc00073c151, 0x10, 0xc000135528)
/go/src/github.com/influxdata/telegraf/plugins/inputs/gnmi/gnmi.go:283 +0x3f1
github .com/influxdata/telegraf/plugins/inputs/gnmi.(*GNMI).handleSubscribeResponse(0xc000878780, 0xc00073c151, 0x10, 0xc0007572c0)
/go/src/github.com/influxdata/telegraf/plugins/inputs/gnmi/gnmi.go:253 +0x70
github .com/influxdata/telegraf/plugins/inputs/gnmi.(*GNMI).subscribeGNMI(0xc000878780, 0x58e03b0, 0xc0006c3620, 0xc00073c151, 0x10, 0x0, 0xc0007563c0, 0x0, 0x0)
/go/src/github.com/influxdata/telegraf/plugins/inputs/gnmi/gnmi.go:245 +0x5a8
github .com/influxdata/telegraf/plugins/inputs/gnmi.(*GNMI).Start.func1(0xc000878780, 0xc0007640d0, 0xc000134b58, 0xc000134b60, 0x590fe58, 0xc00057abe0, 0xc00073c151, 0x10)
/go/src/github.com/influxdata/telegraf/plugins/inputs/gnmi/gnmi.go:147 +0xf5
created by github .com/influxdata/telegraf/plugins/inputs/gnmi.(*GNMI).Start
/go/src/github.com/influxdata/telegraf/plugins/inputs/gnmi/gnmi.go:144 +0x3dd