gNMI clients for SONiC

1,086 views
Skip to first unread message

Serdar Vural

unread,
Feb 16, 2022, 12:07:50 PM2/16/22
to sonicproject
Hello,

I'm new to SONiC and gNMI. Currently running a SONiC VM using one of the 11/2011 images, and can ssh into it.

I'd like to interact with SONiC via the host machine using gNMI and gNOI. I can ping the SONiC VM. The IP of the SONiC VM on the local machine is 10.64.85.105. 

I'm following the examples here: 
https://github.com/Azure/sonic-telemetry/blob/master/doc/gNMI_usage_examples.md

Installed the gnmi_set, gnmi_get and gnmi_cli clients as described.

The Capabilities command works with no issues:
gnmi_cli -insecure -with_user_pass -capabilities -address 10.64.85.105:8080

However, I get errors in any other gnmi command I run at the host. Can you please help me resolve the issue. Am I using the correct set of gNMI clients for SONiC? Do I need to do something else? Here are three examples:

Command: (Subscribe)
gnmi_cli -insecure -logtostderr -address 10.64.85.105:8080 -query_type s -streaming_type TARGET_DEFINED -q /openconfig-interfaces:interfaces/interface[name=Ethernet0]/state/oper-status -target OC-YANG -with_user_pass

Error:
flag provided but not defined: -streaming_type

Command: (Set)
gnmi_set -insecure -username admin -password YourPaSsWoRd -update /openconfig-interfaces:interfaces/interface[name=Ethernet0]/config/mtu:@./set_example.json -target_addr 10.64.85.105:8080 -xpath_target OC-YANG

Error:
flag provided but not defined: -xpath_target

Command: (Get)
gnmi_get -insecure -username admin -password YourPaSsWoRd -xpath /openconfig-interfaces:interfaces/interface[name=Ethernet0]/config -target_addr 10.64.85.105:8080 -xpath_target OC-YANG

Error:
flag provided but not defined: -xpath_target

Regards,
Serdar

Eric Seifert

unread,
Feb 16, 2022, 12:18:54 PM2/16/22
to Serdar Vural, sonicproject
Hello, please see the note in the link:

The above tools also have custom patches applied for additional features here. The patched versions of these tools are built with the sonic-telemetry repo and are installed in /usr/bin in the telemetry container.


These patches have not been upstreamed yet, though I will prioritize doing so

Thanks,
Eric Seifert

--
You received this message because you are subscribed to the Google Groups "sonicproject" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sonicproject...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sonicproject/1bb1cfdf-5fa0-4ddd-894b-855122dbc915n%40googlegroups.com.

Reply all
Reply to author
Forward
0 new messages