← 返回命令列表

Linux command

gnmic-get 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

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

说明

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.

参数

-a _ADDRESS_
Target address.
--path _PATH_
YANG path to retrieve.
--encoding _ENC_
Data encoding (json, proto).
--type _TYPE_
Data type (config, state, all).
--help
Display help information.

FAQ

What is the gnmic-get command used for?

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.

How do I run a basic gnmic-get example?

Run `gnmic get -a [router:57400] --path [/interfaces]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does -a _ADDRESS_ do in gnmic-get?

Target address.