gnmic-get
retrieve configuration or state from gNMI devices
TLDR
Get interface config
$ gnmic get -a [router:57400] --path [/interfaces]
Get with encoding$ gnmic get -a [router:57400] --path [/system] --encoding json
Get multiple paths$ gnmic get -a [router:57400] --path [/interfaces] --path [/system]
Get with type$ gnmic get -a [router:57400] --path [/interfaces] --type config
Print only the values, not full paths$ gnmic get -a [router:57400] --path [/system/name] --values-only
Apply a common prefix to all paths$ gnmic get -a [router:57400] --prefix [/interfaces] --path [interface[name=eth0]]
SYNOPSIS
gnmic get [options]
DESCRIPTION
gnmic get retrieves configuration or state data from gNMI-enabled devices. It fetches data at specified YANG paths and returns it in the requested encoding.The command supports multiple paths, various encodings, and data type filtering. It is used for configuration retrieval and state inspection in network automation workflows.
PARAMETERS
-a, --address ADDRESS
Target address(es), as a global gnmic flag.--path PATH
YANG path to retrieve. Repeatable for multiple paths.--prefix PATH
Common prefix applied to all --path values.--encoding ENC
Data encoding (json, json_ietf, proto, bytes, ascii).--type TYPE
Data type to request: ALL, CONFIG, STATE, or OPERATIONAL. Defaults to ALL.--model NAME
YANG model name to include in the request.--target NAME
Target name to set in the gNMI prefix, for gateway/proxy setups.--values-only
Print only the returned values, omitting the full path structure.--depth N
gNMI extension depth value, limiting how deep results are returned.--help
Display help information.
INSTALL
brew install gnmic
nix profile install nixpkgs#gnmic
CAVEATS
Path must be valid YANG path. Device must support requested encoding. Large datasets may timeout.
HISTORY
gnmic get is a subcommand of gnmic, the gNMI client created by Nokia.
SEE ALSO
gnmic(1), gnmic-set(1), gnmic-subscribe(1)
