Introduzione
Questo documento descrive come trovare altri modelli di nuova generazione (YANG) su un router. Per sapere quali modelli YANG sono supportati su una particolare versione di Cisco IOS® XR, può essere noioso e di tanto in tanto vengono aggiunti nuovi modelli o vengono modificati quelli attuali. Per riferimento, si possono anche trovare modelli YANG su github, ma potrebbero non essere aggiornati.
Di seguito è riportato un collegamento al repository github. github repository
Trova modelli YANG in XR
Di seguito è riportato un esempio in cui sono presenti due modelli non risolti:
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
Gruppi di raccolta:
------------------
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
Dopo aver eseguito il commit delle modifiche, è possibile verificare che i due modelli sono stati risolti.
Di seguito sono riportati alcuni esempi che mostrano come è possibile specificare una parte del percorso del sensore e specificare il contenitore degli ID processo per gli ID processo Cisco-IOS®-XR-nto-misc-shprocmem-oper e non per gli ID processo.
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
Trova modelli YANG in modalità Admin (eXR)
È possibile applicare le stesse entità per trovare un modello YANG in modalità XR - Admin. L'unica differenza è il percorso.
Il percorso in cui si trovano i modelli YANG è: /opt/cisco/calvados/1.00/etc/confd/yang