gnmi-telemetry
gNMI streaming telemetry operations for multi-vendor network devices. Query device state via structured YANG model paths, subscribe to real-time telemetry streams, apply ITSM-gated configuration changes, browse YANG capabilities, and compare gNMI data against CLI output.
MCP Server
gnmi-mcp — gNMI Streaming Telemetry MCP Server (stdio transport)
Tools Used
- gnmi_get — Retrieve device state/config via gNMI Get with YANG paths
- gnmi_set — Apply configuration via gNMI Set (requires ServiceNow CR)
- gnmi_subscribe — Create SAMPLE or ON_CHANGE telemetry subscriptions
- gnmi_unsubscribe — Cancel active subscriptions
- gnmi_get_subscriptions — List all active telemetry subscriptions
- gnmi_get_subscription_updates — Retrieve latest telemetry updates
- gnmi_capabilities — Discover YANG models and encodings on a device
- gnmi_browse_yang_paths — Explore YANG path tree under a module
- gnmi_compare_with_cli — Compare gNMI vs CLI state for validation
- gnmi_list_targets — List configured gNMI target devices
Workflows
Query Device State
gnmi_list_targets— identify available devicesgnmi_capabilities— discover supported YANG modelsgnmi_browse_yang_paths— explore available pathsgnmi_get— retrieve structured state data
Monitor Real-Time Telemetry
gnmi_subscribe— create subscription (SAMPLE or ON_CHANGE)gnmi_get_subscriptions— verify subscription is activegnmi_get_subscription_updates— poll for latest updatesgnmi_unsubscribe— clean up when monitoring is complete
Apply Configuration Change
gnmi_get— capture current baseline stategnmi_set— apply change with ServiceNow CR numbergnmi_get— verify change was applied correctly
Validate gNMI vs CLI
gnmi_compare_with_cli— side-by-side comparison with pyATS data
Supported Vendors
- Cisco IOS-XR (port 57400, JSON_IETF encoding)
- Juniper (port 32767, JSON_IETF encoding)
- Arista (port 6030, JSON encoding)
- Nokia SR OS (port 57400, JSON_IETF encoding)
Required Environment Variables
| Variable | Description |
|---|---|
GNMI_TARGETS |
JSON array of target devices (name, host, port, credentials, vendor) |
GNMI_TLS_CA_CERT |
CA certificate for TLS server verification |
GNMI_TLS_CLIENT_CERT |
Client certificate for mTLS (optional) |
GNMI_TLS_CLIENT_KEY |
Client private key for mTLS (optional) |
Example Usage
Query interface state:
"Show me the interface status on router1 using gNMI"
Subscribe to counters:
"Set up a SAMPLE telemetry subscription for interface counters on switch1 every 30 seconds"
Apply configuration:
"Change the description on GigabitEthernet0/0/0/1 on router1 to 'Uplink to spine' using CR CHG0012345"
Browse capabilities:
"What YANG models does router1 support?"
Safety
- gNMI Get, Subscribe, Capabilities, and Browse are read-only (safe)
- gNMI Set is ITSM-gated: requires a ServiceNow Change Request in "Implement" state
- TLS is mandatory for all connections; mTLS is supported
- All operations are logged to the GAIT audit trail
- Maximum 50 concurrent subscriptions (configurable via GNMI_MAX_SUBSCRIPTIONS)