gnmic-subscribe
subscribe to gNMI streaming telemetry (full form)
TLDR
Subscribe to a path
$ gnmic -a [host:port] subscribe --path [/state/port]
Subscribe with sample interval$ gnmic -a [host:port] subscribe --path [/state/port] --sample-interval [30s]
Subscribe with on-change mode$ gnmic -a [host:port] subscribe --path [/state/port] --stream-mode on-change
Subscribe with heartbeat interval$ gnmic -a [host:port] subscribe --path [/path] --stream-mode on-change --heartbeat-interval [1m]
Subscribe to multiple paths$ gnmic -a [host:port] subscribe --path [/path1] --path [/path2]
Subscribe with authentication$ gnmic -a [host:port] -u [user] -p [pass] subscribe --path [/path]
SYNOPSIS
gnmic subscribe [options]
DESCRIPTION
gnmic subscribe (aliased gnmic sub) sends a gNMI Subscribe RPC to network devices for streaming telemetry. It supports three subscription modes: STREAM (continuous updates, the default), ONCE (immediate single response), and POLL (on-demand). Stream mode supports SAMPLE (periodic, the default) and ON_CHANGE (event-driven) delivery.Results are printed to stdout by default, or routed to a configured output (file, Kafka, NATS, Prometheus, InfluxDB, etc.) via --output.
PARAMETERS
--path path
gNMI path to subscribe to.--mode mode
Subscription mode: STREAM, ONCE, POLL.--stream-mode mode
Stream mode: SAMPLE, ONCHANGE, TARGETDEFINED.--sample-interval duration
Sample interval for SAMPLE mode.--heartbeat-interval duration
Heartbeat interval for ON_CHANGE mode.--suppress-redundant
Suppress redundant updates; only send updates when values actually change.--updates-only
Only send updates, not the initial state snapshot.--quiet
Do not output to stdout.--prefix PATH
Common prefix applied to all --path values.--qos N
DSCP value for packet marking. Defaults to 20; set to 0 to disable.--output NAME
Named output(s), from the config file, to write subscription results to (e.g. a Kafka or Prometheus output) instead of stdout.--name NAME
Run one or more subscriptions predefined in the configuration file, instead of specifying --path on the command line.
INSTALL
brew install gnmic
nix profile install nixpkgs#gnmic
