karimra / gnmic

gNMIc is a gNMI CLI client and collector
https://gnmic.kmrd.dev
Apache License 2.0
216 stars 32 forks source link

How to set Origin field in Path #482

Closed awlx closed 2 years ago

awlx commented 2 years ago

Hey everyone,

first of all thanks for the great software. I am currently working to get smash and sysdb metrics from Arista. With their client they have an option to set the origin to eos_native.

Example:

./gnmi -addr 10.83.28.125:6030 -username arista -password arista subscribe origin=eos_native '/Sysdb/routing/bgp/export/'

It seems to be a valid field in the path attribute. Described here https://github.com/openconfig/reference/blob/master/rpc/gnmi/mixed-schema.md#origin-specification-in-path

Is there a way to set this in gnmic? Maybe I am just blind.

awlx commented 2 years ago

Answering it myself --prefix "eos_native:" fixed it :). That was too easy :D.

karimra commented 2 years ago

Hi @awlx ,

Your solution works, but you can also combine the origin value with the path flag: --path eos_native:/Sysdb/routing/bgp/export

awlx commented 2 years ago

Thank you! :)