Inleiding
Dit document beschrijft hoe u op een router modellen van de volgende generatie (YANG) kunt vinden. Om te weten welke YANG-modellen op een bepaalde Cisco IOS® XR-release worden ondersteund, kan het vervelend zijn om van tijd tot tijd nieuwe modellen toe te voegen of huidige modellen te wijzigen. Ter referentie, kunt u ook YANG modellen op github vinden, maar ze zijn mogelijk niet up-to-date.
Hier is een link naar de github repository. github repository
Zoek YANG modellen in XR
Hier is een voorbeeld waar u twee modellen hebt die niet worden opgelost:
RP/0/RSP0/CPU0:ASR9904-B#show telemetry model-driven subscription 1
Mon Apr 30 04:33:42.421 EST
Subscription: 1
-------------
State: NOT ACTIVE
Sensor groups:
Id: Memory
Sample Interval: 10000 ms
Sensor Path: Cisco-IOS®-XR-nto-misc-oper:memory-summary/nodes/node/summary
Sensor Path State: Not Resolved
Sensor Path: Cisco-IOS®-XR-procmem-oper:processes-memory/nodes/node/process-ids/process-id
Sensor Path State: Not Resolved
Verzamelgroepen:
------------------
No active collection groups
The first thing to do after going into the shell is to change directories to /pkg/yang. This is where the yang models are stored.
The models we specified in the configuration are not resolved because the models do not exist on the router as we can see from the 'ls' commands. When we search for the 'procmem' yang model
for instance we see that it has changed from Cisco-IOS®-XR-procmem-oper to Cisco-IOS®-XR-nto-misc-shprocmem-oper.
However, we should examine this file further to see if anything else has changed in the model structure.
As we can see with this model the container/list process-ids/process-id has changed to job-ids/job-id.
RP/0/RSP0/CPU0:ASR9904-B#
RP/0/RSP0/CPU0:ASR9904-B#
RP/0/RSP0/CPU0:ASR9904-B#run
Mon Apr 30 04:34:04.911 EST
# cd /pkg/yang
# ls -l Cisco-IOS®-XR-nto-misc-oper*
ls: No such file or directory (Cisco-IOS-XR-nto-misc-oper*)
# ls -l Cisco-IOS®-XR-procmem-oper*
ls: No such file or directory (Cisco-IOS-XR-procmem-oper*)
# ls -l Cisco-IOS®-XR-nto-misc*
-rw-r--r-- 2 13707 25 4320 Jun 29 2017 Cisco-IOS®-XR-nto-misc-shmem-oper-sub1.yang
-rw-r--r-- 2 13707 25 1732 Jun 29 2017 Cisco-IOS®-XR-nto-misc-shmem-oper.yang
-rw-r--r-- 2 13707 25 1388 Jun 29 2017 Cisco-IOS®-XR-nto-misc-shprocmem-oper-sub1.yang
-rw-r--r-- 2 13707 25 1719 Jun 29 2017 Cisco-IOS®-XR-nto-misc-shprocmem-oper.yang
# ls -l Cisco-IOS®-XR*procmem*
-rw-r--r-- 2 13707 25 1388 Jun 29 2017 Cisco-IOS®-XR-nto-misc-shprocmem-oper-sub1.yang
-rw-r--r-- 2 13707 25 1719 Jun 29 2017 Cisco-IOS®-XR-nto-misc-shprocmem-oper.yang
#
# more Cisco-IOS®-XR-nto-misc-shprocmem-oper.yang
module Cisco-IOS®-XR-nto-misc-shprocmem-oper {
/*** NAMESPACE / PREFIX DEFINITION ***/
namespace "http://cisco.com/ns/yang"+
"/Cisco-IOS®-XR-nto-misc-shprocmem-oper";
prefix "nto-misc-shprocmem-oper";
/*** LINKAGE (IMPORTS / INCLUDES) ***/
import Cisco-IOS®-XR-types { prefix "xr"; }
include Cisco-IOS®-XR-nto-misc-shprocmem-oper-sub1 {
revision-date 2015-11-09;
}
/*** META INFORMATION ***/
organization "Cisco Systems, Inc.";
contact
"Cisco Systems, Inc.
Customer Service
Postal: 170 West Tasman Drive
San Jose, CA 95134
Tel: +1 800 553-NETS
E-mail: cs-yang@cisco.com";
description
"This module contains a collection of YANG definitions
for Cisco IOS®-XR nto-misc-shprocmem package operational data.
This module contains definitions
for the following management objects:
processes-memory: Process statistics
Copyright (c) 2013-2016 by Cisco Systems, Inc.
All rights reserved.";
revision "2015-11-09" {
description
"IOS® XR 6.0 revision.";
}
container processes-memory {
config false;
description "Process statistics";
container nodes {
description "List of nodes";
list node {
key "node-name";
description "Node ID";
container job-ids {
description "List of jobs";
list job-id {
key "job-id";
description "Job Id";
leaf job-id {
type int32;
description "Job Id";
}
uses PROCESSESMEMORY-ENTRY;
}
}
leaf node-name {
type xr:Node-id;
description "Node name";
}
}
}
}
}
# exit
Nadat u deze veranderingen doorvoert, kunt u zien dat de twee modellen nu worden opgelost.
Hier zijn ook enkele voorbeelden die laten zien dat een deel van het sensorpad kan worden gespecificeerd en dat de taak-id's container moet worden gespecificeerd voor Cisco-IOS®-XR-nto-misc-shprocmem-oper en niet proces-ID's.
RP/0/RSP0/CPU0:ASR9904-B#show telemetry model-driven subscription 1
Tue May 1 06:33:15.986 EST
Subscription: 1
-------------
State: NOT ACTIVE
Sensor groups:
Id: Memory
Sample Interval: 10000 ms
Sensor Path: Cisco-IOS®-XR-nto-misc-oper:memory-summary/nodes/node/summary
Sensor Path State: Not Resolved
Sensor Path: Cisco-IOS®-XR-nto-misc-shmem-oper:memory-summary
Sensor Path State: Resolved
Sensor Path: Cisco-IOS®-XR-nto-shmem-misc-oper:memory-summary
Sensor Path State: Not Resolved
Sensor Path: Cisco-IOS®-XR-nto-misc-shmem-oper:memory-summary/nodes/node/summary
Sensor Path State: Resolved
Sensor Path: Cisco-IOS®-XR-nto-misc-shprocmem-oper:processes-memory/nodes/node/process-ids/process-id
Sensor Path State: Not Resolved
Sensor Path: Cisco-IOS®-XR-nto-misc-shprocmem-oper:processes-memory/nodes/node/job-ids/job-id
Sensor Path State: Resolved
Sensor Path: Cisco-IOS®-XR-procmem-oper:processes-memory/nodes/node/process-ids/process-id
Sensor Path State: Not Resolved
Collection Groups:
------------------
No active collection groups
Zoek YANG-modellen in de Admin Mode (eXR)
Dezelfde principes kunnen worden toegepast om een YANG model in XR te vinden voor de beheermodus, het enige verschil is het pad.
Het pad waar YANG-modellen zich bevinden is hier: /opt/cisco/calvados/1.00/etc/confd/yang