openconfig / gnmic

gNMIc is a gNMI CLI client and collector
https://gnmic.openconfig.net
Apache License 2.0
192 stars 57 forks source link

General Question Tunnel_Server.MD #33

Closed gwizdms closed 1 year ago

gwizdms commented 1 year ago

Learning the ropes here and I am not a developer but interested in setting up a local environment to learn. I have a Centos7 environment and I downloaded gnmic. I have read through parts of the documentation and I am having a difficult time on how to configure a tunnel server gnmi instance. Where can I configure the these fields? Do I need to create a new tunnel.server.config.yaml file or does a default already exists? Where can I find it? Sorry if these are elementary questions.

insecure: true username: admin password: admin

subscriptions: sub1: paths:

gnmi-server: address: :57400

tunnel-server: address: :57401 targets:

karimra commented 1 year ago

Hi, this config file is a good start.

insecure: true
log: true
username: admin
password: admin

subscriptions:
  sub1:
    paths:
      - /state/port
    sample-interval: 10s

tunnel-server:
  address: :57401
  targets:
    - id: .*
      type: GNMI_GNOI

You will have to put that in a yaml file and supply it to gnmic when your run it: (note the --use-tunnel-server flag) gnmic --config tunnel.server.config.yaml --use-tunnel-server subscribe

The gnmi-server: section in your example is only needed if you want to run gNMIc as both a tunnel server and a gNMI server.

The config: section under targets is needed if you want to map different target configs to each tunnel client matching the regex under id:.

With the above file, gNMIc will write the notifications to the terminal on stdout. Check the outputs docs for other options: https://gnmic.openconfig.net/user_guide/outputs/output_intro/

karimra commented 1 year ago

@gwizdms any luck setting up a tunnel server gNMIc instance?

gwizdms commented 1 year ago

Working on multiple projects. Will revisit soon. Will close and reach out if I have additional questions. TY.