LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

gnmic-sub

subscribe to gNMI streaming telemetry

TLDR

Subscribe to a path
$ gnmic -a [host:port] sub --path [/state/port]
copy
Subscribe with sample interval
$ gnmic -a [host:port] sub --path [/state/port] --sample-interval [30s]
copy
Subscribe with on-change mode
$ gnmic -a [host:port] sub --path [/state/port] --stream-mode on_change
copy
Subscribe with heartbeat interval
$ gnmic -a [host:port] sub --path [/path] --stream-mode on_change --heartbeat-interval [1m]
copy
Subscribe to multiple paths
$ gnmic -a [host:port] sub --path [/path1] --path [/path2]
copy
Subscribe with authentication
$ gnmic -a [host:port] -u [user] -p [pass] sub --path [/path]
copy

SYNOPSIS

gnmic sub | subscribe [options]

DESCRIPTION

gnmic sub (or subscribe) sends a gNMI Subscribe RPC to network devices for streaming telemetry. It supports multiple subscription modes: once (immediate single response), poll (on-demand), and stream (continuous updates). Stream mode supports sample (periodic), on_change (event-driven), and target_defined delivery.

PARAMETERS

--path path

gNMI path to subscribe to.
--mode mode
Subscription mode: STREAM, ONCE, POLL (default STREAM).
--stream-mode mode
Stream mode: sample, onchange, targetdefined (default sample).
--prefix prefix
Set a common prefix for all paths.
--target target
Set path target in the SubscriptionList prefix field.
--qos value
QoS marking for subscription responses (default 20, 0 to disable).
--sample-interval duration
Interval for target to send samples (e.g. 1s, 1m30s).
--heartbeat-interval duration
Heartbeat interval for on_change or sample modes.
--suppress-redundant
Suppress updates unless value has changed since last update.
--updates-only
Only send updates, not initial state.
--quiet
Do not output subscription responses to stdout.
--format format
Output format (json, protojson, prototext, event, flat).
--name name
Trigger predefined subscriptions from configuration file.
--output output
Select output provider(s) defined in configuration file.
--depth depth
Set gNMI extension depth value.
--history-snapshot time
Set history snapshot value (nanoseconds or RFC3339 format).
--set-target
Set SubscribeRequest Prefix target to configured target name.

SEE ALSO

Copied to clipboard
Kai