Skip to content

Instantly share code, notes, and snippets.

@hellt
Last active October 22, 2020 14:21
Show Gist options
  • Select an option

  • Save hellt/333b10e0ade32b73d388e4f996ad387e to your computer and use it in GitHub Desktop.

Select an option

Save hellt/333b10e0ade32b73d388e4f996ad387e to your computer and use it in GitHub Desktop.
gnmic and Cisco IOS-XR

Starting the lab

Start Model Driven Telemetry Lab.

Installing gNMIc

Login into the devbox VM inside this lab and clone the gnmic-bin repo to have the gnmic binary available inside the lab:

git clone https://github.com/hellt/gnmic-bin.git
mv gnmic-bin/gnmic ~/gnmic

Getting YANG models

git clone https://github.com/YangModels/yang

Running gnmic

Run gnmic with XR's OpenConfig models matching the release running in the Lab (6.5.3)

./gnmic --address 10.10.20.35 --insecure -e json_ietf \
        --username admin --password Cisco123 \
        --file yang/vendor/cisco/xr/653/openconfig-interfaces.yang \
        --dir yang/standard/ietf/ \
        --exclude ietf-interfaces \
        prompt

Make path adjustments

When you constructed the path with the help of auto-suggestions, with XR you need to make one addition because XR's gNMI interfaces uses outdated way to distinct the models used in conjunction with the path. A user needs to append the module name to the path, so if the path is /interfaces/interfaces, the openconfig-interfaces module name needs to be prepended like that:

openconfig-interfaces:interfaces/interface

Output:

gnmic> get --path openconfig-interfaces:interfaces/interface
Get Response:
[
  {
    "timestamp": 1603291718169945610,
    "time": "2020-10-21T14:48:38.16994561Z",
    "updates": [
      {
        "Path": "openconfig-interfaces:interfaces/interface",
        "values": {
          "interfaces/interface": [
            {
              "config": {
                "enabled": true,
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment