RLReadyLinks Docs

gNMI and gRPC dial-out alarms

Stream ReadyLinks switch alarms to a gNMI collector with an ON_CHANGE subscription, either directly or through the switch's gRPC dial-out tunnel. Covers paths, payload, TLS and mTLS, CLI, and a gnmic example.

The switch runs a gNMI server. A collector that subscribes ON_CHANGE to /readylinks-rlos:notification-status receives every alarm that is also sent as a NETCONF notification. There are two ways to reach the server:

ModeWho connectsUse when
Dial-inThe collector connects to the switch on TCP 10000The collector can reach the switch
Dial-outThe switch connects out to your tunnel server on TCP 10001, and the collector's gNMI session runs inside that tunnelThe switch is behind NAT or a firewall that blocks inbound connections

Dial-out uses the OpenConfig grpctunnel protocol. Up to two dial-out servers can be set.

#Subscription

FieldValue
RPCgNMI.Subscribe
SubscriptionList.modeSTREAM
Subscription.modeON_CHANGE
Subscription.path/readylinks-rlos:notification-status. The first element must carry the module prefix
prefixNot used. Put the full path in each subscription
EncodingThe switch always replies with json_val
  • One subscription per request. The switch serves only the first ON_CHANGE subscription in a SubscribeRequest. Use one request for alarms, and separate requests for anything else.
  • No initial sync. No sync_response is sent. The stream stays quiet until the first alarm.
  • No authentication. The gNMI server does not check a username or password. Access is controlled by TLS or mTLS (see Security).

#Payload

Each alarm arrives as one SubscribeResponse.update:

FieldValue
timestampTime the switch sent the update, in nanoseconds since the Unix epoch
prefixUnset
update[0].pathThe path from your subscription
update[0].val.json_valA JSON object with one key, the leaf name, set to the message text

The leaf names and message formats are listed in Leaves and message formats.

text
update {
  timestamp: 1792591391520000000
  update {
    path { elem { name: "readylinks-rlos:notification-status" } }
    val { json_val: "{\"switch-port-downspeed\":\" Ethernet0/5's speed is 1000M, it support max speed is 2500M!\"}" }
  }
}
json
{"ghn-port-status": "ifIndex.3 linkDown mac: 00-13-ba-0c-68-57 name: modem-example"}

#Prerequisites

  1. NETCONF is enabled (netconf enable). The gRPC service depends on it.
  2. The global trap switch is on (snmp-server traps). Alarms follow the same switches as SNMP traps (see Gating). You don't need any trap receivers.
  3. gRPC is enabled (grpc enable).

#Configure the switch

The grpc settings can be changed only while gRPC is stopped. Run grpc disable first, make the changes, then grpc enable.

#Dial-in

shell
configure terminal
grpc disable
grpc grpchost 10000
grpc authentication enable
grpc enable
end
CommandDoesDefault
grpc enable / grpc disableStart or stop the gRPC service. NETCONF must be running to enable itDisabled
grpc grpchost <port>gNMI server port, 1-65535. Takes a port only10000
grpc httphost <port>HTTP port of the gRPC service, 1-65535. Takes a port only and must differ from the gNMI port8080
grpc authentication enableUse TLS on the gNMI server (disable uses plaintext)Enable
grpc mtls enableAlso require a client certificate (disable uses TLS only). Needs authentication enabledDisable

#Dial-out

shell
configure terminal
grpc disable
grpc dialouthost 192.0.2.60 10001
grpc dialoutauthentication enable
grpc dialoutmtls enable
grpc certificate-upload filetype ca-file filename tunnel-ca.pem tftp 192.0.2.5
grpc certificate-upload filetype cert-file filename switch-client.crt tftp 192.0.2.5
grpc certificate-upload filetype key-file filename switch-client.key tftp 192.0.2.5
certificate-effect
grpc dialtargetId | hostname vendor model version
grpc dialout enable
grpc enable
end
Server 1Server 2DoesDefault
grpc dialout {enable|disable}grpc dialout2 {enable|disable}Turn the dial-out connection on or offDisable
grpc dialouthost <ip> <port>grpc dialout2host <ip> <port>Tunnel server address (IPv4 or IPv6) and port, 1-65535—
grpc dialoutauthentication {enable|disable}grpc dialout2authentication {enable|disable}TLS on the tunnel connection (disable uses plaintext)Enable
grpc dialoutmtls {enable|disable}grpc dialout2mtls {enable|disable}enable: mTLS with a client certificate. disable: TLS only. Needs dial-out authentication enabledEnable
grpc certificate-upload filetype {ca-file|cert-file|key-file} filename <file> tftp <ip>grpc certificate-upload2 ...Load the tunnel CA, client certificate, or client key from a TFTP server—
grpc dialtarget <name>grpc dialtarget2 <name>Set the custom value used in the target ID, up to 32 characters—
grpc dialtargetId <delimiter> <p1> [<p2> ... <p5>]grpc dialtarget2Id ...Build the target IDhostname|ReadyLinks|model|version
  • certificate-effect. Run this in global config mode to apply uploaded certificates straight away.
  • dialtargetId delimiter. One of |, : or ;.
  • dialtargetId parameters. One to five of hostname, vendor (the literal ReadyLinks), model, version (firmware version), and custom (the dialtarget value). Each can be used only once.

#Check

show grpc shows the service state, TLS and mTLS settings, the gNMI and HTTP ports, and for each dial-out server its state, host, port, target, target ID, and tunnel status.

#How dial-out works

  1. The switch opens a gRPC connection to the tunnel server, using TLS or mTLS as configured, and registers its target. The target type is GNMI_GNOI, and the target ID is set by dialtargetId.
  2. The collector asks the tunnel server for a session to that target.
  3. The switch accepts the session and connects it to its local gNMI server. The collector then runs Subscribe through the tunnel, exactly as for dial-in.
  4. If the connection to the tunnel server fails, the switch retries. The wait starts at 3 s and grows to at most 30 s between attempts.

The switch accepts a tunnel session only if the requested target ID starts with its own target ID and the type is GNMI_GNOI.

#Security

LegServer certificateClient certificateTrust
Switch → tunnel serverYour tunnel server'sThe switch's uploaded cert-file / key-file, with mTLSThe switch checks the tunnel server against the uploaded ca-file
Collector → switch gNMI, dial-in or inside the tunnelThe switch's HTTPS certificateRequired only with grpc mtls enableWith mTLS, the switch checks client certificates against the HTTPS CA
  • Shared certificate. The gNMI server uses the same certificate, key and CA as the switch's HTTPS web server. Replacing the HTTPS certificate replaces the gNMI one too.
  • TLS version. With grpc authentication enable, the gNMI server accepts TLS 1.3 only.

#Collector example (gnmic)

gnmic can act as the tunnel server and the gNMI client in one process. This is an example configuration. See the gnmic documentation for every option.

yaml
# gnmic.yaml
tunnel-server:
  address: ":10001"
  tls:
    ca-file: /etc/gnmic/switch-ca.pem      # CA that signed the switches' client certificates
    cert-file: /etc/gnmic/tunnel-server.crt
    key-file: /etc/gnmic/tunnel-server.key
    client-auth: require-verify            # mTLS
  targets:
    - id: ".*"
      type: GNMI_GNOI
      config:
        skip-verify: true                  # or tls-ca: the CA of the switch HTTPS certificate
        encoding: json

subscriptions:
  rlos-alarms:
    paths:
      - /readylinks-rlos:notification-status
    mode: stream
    stream-mode: on-change
    encoding: json

outputs:
  stdout:
    type: file
    file-type: stdout
    format: event
shell
gnmic --config gnmic.yaml --use-tunnel-server subscribe

For dial-in, point gnmic at the switch directly:

shell
gnmic -a 192.0.2.20:10000 --skip-verify -e json \
  subscribe --path /readylinks-rlos:notification-status --mode stream --stream-mode on-change

To test, unplug and reconnect a cable on a port with traps enabled. Two switch-port-status updates arrive, one for ifIndex.<N> linkDown and one for ifIndex.<N> linkUp.

Edit this page on GitLab

Last updated October 21, 2026