Forrest logo
back to the gnmic tool

gnmic-subscribe:tldr:e905f

gnmic-subscribe: Subscribe to a target with a sample interval of 30s (default is 10s).
$ gnmic -a ${ip:port} subscribe --path ${path} --sample-interval 30s
try on your machine

This command is using the gnmic tool to establish a subscription and receive updates from a network device using the gNMI (gRPC Network Management Interface) protocol. Let's break down the command:

  • gnmic: This is the command-line tool used for interacting with network devices using gNMI.
  • -a ${ip:port}: This flag specifies the address of the target network device. It is expecting an IP address and port number in the format ${ip:port}. You need to replace ${ip} with the actual IP address and ${port} with the desired port number.
  • subscribe: This command tells gnmic to establish a subscription.
  • --path ${path}: This flag specifies the path to the data that should be subscribed to. You need to replace ${path} with the actual gNMI path you want to subscribe to on the network device. For example, /interfaces/interface[name=eth0]/state/counters would subscribe to the counters of the eth0 interface.
  • --sample-interval 30s: This flag sets the sample interval, which is the frequency at which updates will be received. In this case, it is set to 30s, which means updates will be received every 30 seconds.

To use this command, you need to replace ${ip:port} with the actual IP address and port number of the target network device, and ${path} with the desired gNMI path to subscribe to.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the gnmic tool