Table of Contents
- About the gnmi tool
- gnmi installation
- Use gnmi
gnmi is a command-line gNMI client.
source code https://github.com/aristanetworks/goarista/tree/master/cmd/gnmi
GO is required to install gnmi.
Please follow these instructions to install GO on your automation setup
This will install the gnmi binary in the $HOME/go/bin directory.
go install github.com/aristanetworks/goarista/cmd/gnmi@latest
ls $GOPATH/pkg/mod/github.com
ls $GOPATH/bin/
ls $HOME/go/bin/
gnmi --help
Go to Devices > Inventory and replace the target in the commands below with the device ID
found in the CVP device inventory.
The device ID
is the device SN.
gnmi -addr=192.168.0.5:443 -token=`cat token.tok` -mode=stream subscribe \
origin=openconfig target=spine1 /interfaces/interface/state/admin-status
gnmi -addr=192.168.0.5:443 -token=`cat token.tok` -mode=once \
-history_snapshot=2022-07-17T12:48:00Z subscribe origin=openconfig \
target=spine1 /interfaces/interface[name=Ethernet2]/state/admin-status
gnmi -addr=192.168.0.5:443 -token=`cat token.tok` -mode=stream \
-history_start=2022-07-17T12:48:00Z -history_end=2022-07-17T16:04:00Z \
subscribe origin=openconfig target=spine1 /interfaces/interface[name=Ethernet2]/state/admin-status