Introdução
Este documento descreve como encontrar modelos de YearG (Another Next Generation) em um roteador. Para saber quais modelos YANG são suportados em uma versão específica do Cisco IOS® XR pode ser entediante, e de tempos em tempos novos modelos são adicionados ou modelos atuais são alterados. Como referência, você também pode encontrar modelos YANG no github, mas eles podem não estar atualizados.
Aqui está um link para o repositório github. repositório github
Encontre modelos YANG em XR
Aqui está um exemplo onde você tem dois modelos que não são resolvidos:
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
Grupos de Coleção:
------------------
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
Depois de confirmar essas alterações, você poderá ver que os dois modelos agora estão resolvidos.
Aqui também estão alguns exemplos que mostram que uma parte do caminho do sensor pode ser especificada e o contêiner job-ids deve ser especificado para Cisco-IOS®-XR-nto-misc-shprocmem-oper e não process-ids.
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
Localizar modelos YANG no modo de administração (eXR)
Os mesmos princípios podem ser aplicados a fim de encontrar um modelo YANG no modo XR para admin, a única diferença é o caminho.
O caminho onde os modelos da YANG estão localizados é aqui: /opt/cisco/calvados/1.00/etc/confd/yang