Introduction to gNMIc

      Comments Off on Introduction to gNMIc

gNMIc is a gNMI CLI client that provides full support for gNMI RPCs. Nokia developed the gNMIc and donated it to the open-source community, OpenConfig. gNMIc is widely used by the open-source community, developers, and networking vendors.

To understand how gNMIc works, let’s introduce gNMI.

What is gNMI?

gNMI (gRPC Network Management Interface) was developed by Google to provide a mechanism to install, update, and delete the configuration of network devices, and also to view operational data. gRPC is a popular implementation of RPC (Remote Procedure Call), which is a communication protocol that allows one computer to execute a procedure or a function on another computer.

In networking, SNMP (simple network management protocol) is a widely used protocol to monitor networks using a pull-based model where the monitoring system periodically requests measurement data from network devices. This method can consume considerable resources and it does not scale well in large networks. Also, polling may cause delays in detecting problems that occur between polls.

In contrast, gNMI relies on push-based approach to streaming that allows network devices to stream data continuously and automatically to a centralized location. This approach enables near real-time network data collection, significantly improving network monitoring task. gNMI also leverages standardized data models, such as IETF YANG and OpenConfig for data collections. As such, gNMI offers an implemented alternative to NETCONF or RESTCONF.

gNMI follows a client-server model, where the server (aka target) is the monitored network device and the client is the monitoring device. The gNMI operations include:

  • Capabilities: The client requests the target’s capabilities (supported YANG models and their revision date).
  • Get: The client retrieves a snapshot of the data identified by a path from the target.
  • Set: The client modifies the configuration of the target.
  • Subscribe: The client can subscribe to data identified by a set of paths, the target will stream back the data to the client periodically or when it changes.


As mentioned earlier, gNMIc is a client interface to gNMI. gNMIc is also a telemetry collector and it provides Go APIs as well.


The gNMIc provides the following commands:

  • RPC commands, which include Capabilities Request, Get Request, Set Request, and Subscribe Request.
  • Utility Commands, which include Prompt, Generate, Diff, and others.

gNMIc is configured in three methods:

  • CLI flags: the flags are supplied in the command line.
  • ENV variables: the flags are supplied as environment variables.
  • Configuration file: the flags are supplied in a file (e.g. YAML).

These configuration methods can be mixed with the top methods overriding the bottom ones if there is a conflict.

RPC Commands

The gNMIc commands are modeled after the gNMI specifications. Each field in the GetRequest/SetRequest is mapped to a gNMIc flag.

Set commands can be inline, for small requests, or they can use files, which can be templated.

Subscribe commands can send any received telemetry data to multiple outputs, such as a database or a file. One possible output is SNMP, were telemetry can be mapped to SNMP traps. There are multiple subscription modes: once, pull, or stream (which has multiple options as well).

Utility Commands

The Generate command allows generating configuration payload in YAML, which can be modified manually. The command also has a “paths” subcommand that generates all possible xpaths.

The Collector

gNMIc can be used a highly available gNMI collector. The gNMIc targets can be specified in the flags or in a configuration file. The targets can be discovered dynamically as well.

The configuration file can specify the subscriptions. Each subscription can have its own options. The subscriptions are bound to a target. The configuration file specify the outputs and processors, which can perform the following:

  • Data manipulation (conversion, aggregation, etc.)
  • Filtering
  • Trigger action

gNMIc clustering

Multiple instances of gNMIc can form a cluster. The clustering can provide the scalability needed to manage thousands of devices. Clustering also provides redundancies to tolerate collector failures. gNMIc provides load balancing by automatically distributing targets among the cluster members.

gNMIc Demo

To demonstrate the usage of gNMIc in collecting network telemetry, I have created a Github repository that can be used to deploy a network using containerlab and Nokia srlinux routers.


This post offers a brief overview of gNMIc capabilities and features. Mainly, gNMIc is an interface to gNMI, which is a Google-developed protocol for network management, offering an efficient push-based approach for real-time data streaming. gNMIc runs as a single binary on any platform, and it provides RPC and utility commands for network device management and monitoring. gNMIc also supports clustering for scalability and redundancy, allowing management of thousands of devices and load balancing across cluster members.