LinuxCommandLibrary

gnmic

Interact with network devices using gNMI

TLDR

Request device capabilities

$ gnmic [[-a|--address]] [ip:port] capabilities
copy

Provide a username and password to fetch device capabilities
$ gnmic [[-a|--address]] [ip:port] [[-u|--username]] [username] [[-p|--password]] [password] capabilities
copy

Get a snapshot of the device state at a specific path
$ gnmic [[-a|--address]] [ip:port] get --path [path]
copy

Update device state at a specific path
$ gnmic [[-a|--address]] [ip:port] set --update-path [path] --update-value [value]
copy

Subscribe to target state updates under the subtree at a specific path
$ gnmic [[-a|--address]] [ip:port] subscribe --path [path]
copy

SYNOPSIS

gnmic [global flags] command [command flags] [command arguments]

PARAMETERS

address
    Server address(es) to connect to (comma separated).

username
    Username for authentication.

password
    Password for authentication.

tls-ca
    Path to the TLS CA certificate file.

tls-cert
    Path to the TLS client certificate file.

tls-key
    Path to the TLS client key file.

insecure
    Disable TLS certificate verification.

format
    Output format (json, proto, flat, gocsv, csv, table, row, influx, influx2, elastic, cloudwatch, cloudwatchlogs, file). Defaults to json.

debug
    Enable debug mode.

version
    Show version and exit.

DESCRIPTION

gnmic is a versatile command-line tool that acts as a gNMI (gRPC Network Management Interface) client.
It enables querying, configuring, and monitoring network devices that support the gNMI protocol. It allows users to interact with network devices through gRPC, facilitating automation and management tasks.
gnmic simplifies interaction by providing a command-line interface to construct gNMI requests.
gnmic supports various output formats (e.g., JSON, YAML, CSV), different authentication methods, and secure connections using TLS.
It is commonly used to retrieve device status, perform configuration changes, subscribe to telemetry data streams, and diagnose network issues on devices that expose gNMI endpoints.
gnmic supports features like filtering, data manipulation, and aggregation, making it a powerful tool for network engineers and automation specialists.

CAVEATS

Requires gNMI support on the target network device.

SUBCOMMANDS

gnmic supports multiple subcommands such as:
- get: retrieves data from a device.
- set: configures a device.
- subscribe: subscribes to telemetry data.

OUTPUT FORMATS

gnmic provides flexibility in handling the output with formats like JSON, YAML, and CSV. These formats can be easily parsed by other tools or scripts for further processing.

HISTORY

gnmic has been developed to streamline the interaction with gNMI enabled network devices. Its development aimed to offer a simplified command-line interface to the complexity of gNMI, enabling automation and management tasks for network engineers and operators.
It has become widely used in modern network automation workflows, particularly in environments adopting model-driven network management and telemetry.

SEE ALSO

grpc(1), netstat(1), tcpdump(1)

Copied to clipboard