• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • VCS
  • Interview Questions
  • Database
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

“gnmic subscribe” Command Examples

by admin

The gnmic subscribe command is a crucial feature of the gnmic tool, specifically designed for monitoring and receiving real-time updates on the state of network devices that support the gNMI (gRPC Network Management Interface) protocol. This command facilitates the establishment of a continuous stream of information, allowing network administrators and operators to stay informed about changes in the operational status of their network infrastructure.

Key Features

Real-Time Monitoring: The primary purpose of gnmic subscribe is to enable real-time monitoring of network device states. By subscribing to updates, users can receive immediate notifications whenever there are changes in parameters such as interface status, routing tables, or other operational metrics.

gNMI Protocol: The command leverages the gNMI protocol, which is based on gRPC, ensuring efficient and bidirectional communication between the management system and the network device. The use of gRPC facilitates high-performance streaming of updates, allowing for timely and accurate monitoring.

Subscription Models: Users can define subscription models based on specific data paths and filters. This enables them to tailor their subscriptions to receive updates for specific components or aspects of the network, avoiding unnecessary data traffic and focusing on the information relevant to their monitoring requirements.

Streaming Updates: The gnmic subscribe command establishes a persistent connection to the target network device, creating a stream of updates. This streaming approach ensures that administrators receive continuous and immediate notifications as soon as there are changes in the device’s operational state.

“gnmic subscribe” Command Examples

1. Subscribe to target state updates under the subtree of a specific path:

# gnmic --address ip:port subscribe --path path

2. Subscribe to a target with a sample interval of 30s (default is 10s):

# gnmic -a ip:port subscribe --path path --sample-interval 30s

3. Subscribe to a target with sample interval and updates only on change:

# gnmic -a ip:port subscribe --path path --stream-mode on-change --heartbeat-interval 1m

4. Subscribe to a target for only one update:

# gnmic -a ip:port subscribe --path path --mode once

5. Subscribe to a target and specify response encoding (json_ietf):

# gnmic -a ip:port subscribe --path path --encoding json_ietf

Summary

The gnmic subscribe command offers several benefits, including proactive monitoring, rapid issue detection, and the ability to respond promptly to changes in the network environment. It plays a crucial role in enhancing network visibility, aiding troubleshooting efforts, and ensuring the overall health and performance of the network infrastructure.

Filed Under: Linux

Some more articles you might also be interested in …

  1. rtcwake Command Examples in Linux
  2. watch Command Examples in Linux
  3. mate-search-tool: command not found
  4. kvm-img: command not found
  5. How to increase swap space on Linux
  6. How to Install awscli
  7. How to take mailbox backup of Zimbra Account from CLI
  8. idle3: command not found
  9. i3 Command Examples in Linux
  10. udevadm: command not found

You May Also Like

Primary Sidebar

Recent Posts

  • Vanilla OS 2 Released: A New Era for Linux Enthusiasts
  • mk Command Examples
  • mixxx Command Examples
  • mix Command Examples

© 2025 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright