Skip to content

Instantly share code, notes, and snippets.

@sulrich
sulrich / gnmic-use-notes.md
Last active March 21, 2021 15:20
random arista gnmi / gnmic notes

getting show commands via gnmi

most/lots of our show commands are json framed (you can check this from the cli by piping the command through |json from the CLI. this is also what we effectively expose via eAPI. this also also accessible via gnmi. you just feed the command in with the origin set to cli. note, the syntax w/gnmic is a little janky, but you get the idea.

krusty(~)% gnmic -a 192.168.1.21:6030 -u admin -p arista --insecure \
 get --path "cli:/show version"
Get Response:
[
  {
[user@host ~]$ influx
Connected to http://localhost:8086 version 1.5.2
InfluxDB shell version: 1.5.2
> use lanz
Using database lanz
> select * from congestion_record order by time desc limit 10
name: congestion_record
time entry_type host hostname intf_name port port_id q_drop_count queue_size switch_id time_of_max_qlen timestamp traffic_class tx_latency
---- ---------- ---- -------- --------- ---- ------- ------------ ---------- --------- ---------------- --------- ------------- ----------
1527250808255589742 3 xxxxxxxxxxxxxxxxxxx yyyyyyyyyyyyyyyyyyyy Ethernet35 50001 33 0 15 0 0 152725080820836 1 5790