cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
100
Views
0
Helpful
2
Replies
Highlighted
Beginner

mismatch while entering a command to device vs device template

Dear Community members,

 

I need some help.

 

While creating a Device Template,  i cannot enter some CLI command into device template, although i can execute them on the Device ( either directly on device CLI or via NSO, it is same ).

 

I appreciate any guidance on the reason for this and guidance on how to run a Compliance report for those commands as i cannot enter them into the template.

 

nso ver : 5.3.0.1

ned : cisco-ios-cli-6.43

 

Definition of the issue : 

CASE 1 : ntp server

i can execute command 

ntp server 195.33.242.133

on the device, but not on the Device Template

 

CSE 2 : logging

i can execute command

logging 10.210.162.238

on the device, but not on the Device template..

 

 

Below are command execution output for like "logging ? " or "ntp server ? " and my notes and YANG portion for these commands out of IOS NED for both cases :

 

CASE 1 : ntp server

 

When i try to execute command on Device 

admin@ncs(config-config)# ntp server ?
Possible completions:
     <IP address>                                                                  <--- there is IP address field here
     <string, min: 1 chars, max: 253 chars>
     <Hostname, A.B.C.D or X:X:X:X::X> Address of peer
     ip Use IP for DNS resolution
     ipv6 Use IPv6 for DNS resolution
     vrf VPN Routing/Forwarding Information

 

 

When i try to execute command on Template : 

admin@ncs(config-config)# ntp server ?
Possible completions:
ip ipv6 peer-list vrf                                                                <--- there is peer-list field here, in which there is IP address

 

 

IOS YANG  for ntp server :

 

    // ntp server *
    container server {
      tailf:info "Configure NTP server";
      uses ntp-peer-grouping;
      // ntp server ip *
      container ip {
        tailf:info "Use IP for DNS resolution";
        tailf:cli-compact-syntax;
        uses ntp-peer-grouping;
      }
      // ntp server ipv6 *
      container ipv6 {
        tailf:info "Use IPv6 for DNS resolution";
        tailf:cli-compact-syntax;
        uses ntp-peer-grouping;
      }
      // ntp server vrf *
      list vrf {
        tailf:info "VPN Routing/Forwarding Information";
        tailf:cli-suppress-mode;
        tailf:cli-delete-when-empty;
        tailf:cli-compact-syntax;
        tailf:cli-reset-container;
        tailf:cli-incomplete-command;
        key name;
        leaf name {
          tailf:cli-diff-dependency "../../../../ip/vrf";
          tailf:cli-diff-dependency "../../../../vrf/definition";
          type string {
            tailf:info "WORD;;VPN Routing/Forwarding instance name";
          }
        }
        uses ntp-peer-grouping;
      }
    }

 

 

  grouping ntp-peer-grouping {
    list peer-list {
      tailf:cli-drop-node-name;
      tailf:cli-suppress-mode;
      tailf:cli-delete-when-empty;
      tailf:cli-compact-syntax;
      tailf:cli-reset-container;
      key name;
      leaf name {
        tailf:cli-disallow-value "vrf";
        type inet:host {
          tailf:info "Hostname, A.B.C.D or X:X:X:X::X;;Address of peer";
        }
      }
      leaf burst {
        tailf:info "Send a burst when peer is reachable (Default)";
        type empty;
      }
      leaf iburst {
        tailf:info "Send a burst when peer is unreachable (Default)";
        type empty;
      }
      leaf key {
        tailf:info "Configure peer authentication key";
        type uint32 {
          tailf:info "<1-4294967295>;;Peer key number";
          range "1..4294967295";
        }
      }
      leaf maxpoll {
        tailf:info "Maximum poll interval";
        type uint8 {
          tailf:info "<4-17>;;Poll value in Log2";
          range "4..17";
        }
      }
      leaf minpoll {
        tailf:info "Minimum poll interval";
        type uint8 {
          tailf:info "<4-17>;;Poll value in Log2";
          range "4..17";
        }
      }
      leaf normal-sync {
        tailf:info "Disable rapid sync at startup";
        type empty;
      }
      leaf prefer {
        tailf:info "Prefer this peer when possible";
        type empty;
      }
      container source {
        tailf:info "Interface for source address";
        tailf:cli-flatten-container;
        tailf:cli-compact-syntax;
        uses interface-name-grouping;
      }
      leaf version {
        tailf:info "Configure NTP version";
        type uint8 {
          tailf:info "<1-4>;;NTP version number";
        }
      }
    }
  }
 
CASE 2: logging
 
When i try to execute command on Device :
 
admin@ncs(config-config)# logging ?
Possible completions:
  <IP address>
  <string, min: 1 chars, max: 253 chars>
  <Hostname or A.B.C.D>   IP address of the logging host           <-------------  there is hostname for Template, see blow
  alarm                   Configure syslog for alarms
  buffered                Set buffered logging parameters
  cmts                    CMTS config commands
  console                 Set console logging parameters
  discriminator           Create or modify a message discriminator
  esm                     Set ESM filter restrictions
  event                   Global interface events
  exception               Limit size of exception flush output
  facility                Facility parameter for syslog messages
  history                 Configure syslog history table
  host                    Set syslog server IP address and parameters
  ip                      IP configuration
  linecard                specify logging parameters for a linecard messages
  message-counter         Configure log message to include certain counter value
  monitor                 Set terminal line (monitor) logging parameters
  origin-id               Add origin ID to syslog messages
  persistent              Set persistent logging parameters
  queue-limit             Set logger message queue size
  rate-limit              Set messages per second limit
  reload                  Set reload logging level
  snmp-authfail           
  snmp-trap               Set syslog level for sending snmp trap
  source-interface        Specify interface for source address in logging
                          transactions
  trap                    Set syslog server logging level
 
When i try to execute command on Template : 
 
admin@ncs(config-config)# logging ?
Possible completions:
  alarm             buffered       cmts             
  console           discriminator  esm              
  event             exception      facility         
  history           host           hostname                    <-------------  there is no as such hostname for Device CLI, see above
  ip                linecard       message-counter  
  monitor           origin-id      persistent       
  queue-limit       rate-limit     rate-limit-conf  
  reload            snmp-authfail  snmp-trap        
  source-interface  trap   
 
 
IOS YANG for logging :   ( is very long, hence i only included the hostname portion , which -i believe- for "logging <IP Address>" 
 
  container logging {
    tailf:info "Modify message logging facilities";

    // logging *
    list hostname {
      tailf:info "Hostname or A.B.C.D;;IP address of the logging host";
      tailf:cli-drop-node-name;
      tailf:cli-suppress-mode;
      tailf:cli-delete-when-empty;
      key host;
      leaf host {
        tailf:cli-disallow-value "esm|alarm|buffered|facility"+
          "|history|rate-limit|source-interface|host|console";
        tailf:cli-full-command;
        type inet:host {
          tailf:info "Hostname or A.B.C.D;;IP address of the logging host";
        }
      }
    }
 
 
1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Beginner

Hi,

The NTP commands in your template should look like:

 

<config>
       <ntp xmlns="http://tail-f.com/ned/cisco-ios-xr">
        <server>
          <server-list>
            <name>1.2.3.4</name>
          </server-list>
        </server>
        <source>
          <Loopback>0</Loopback>
        </source>
      </ntp> 
      </config>

Similarly, your logging configuration in the template should look like

<config>
        <logging xmlns="http://tail-f.com/ned/cisco-ios-xr">
          <trap>debugging</trap>
          <monitor>debugging</monitor>
          <buffered>
            <type>informational</type>
          </buffered>
          <host>
            <address>1.2.3.4</address>
            <vrf>default</vrf>
            <severity>info</severity>
            <port>default</port>
          </host>
        </logging> 
      </config>

One thing that helps figure these types of things out is to go to a device that has the configuration you want and issue command like:

show running-configuration | display xml

regards

Richard

View solution in original post

2 REPLIES 2
Highlighted
Beginner

Hi,

The NTP commands in your template should look like:

 

<config>
       <ntp xmlns="http://tail-f.com/ned/cisco-ios-xr">
        <server>
          <server-list>
            <name>1.2.3.4</name>
          </server-list>
        </server>
        <source>
          <Loopback>0</Loopback>
        </source>
      </ntp> 
      </config>

Similarly, your logging configuration in the template should look like

<config>
        <logging xmlns="http://tail-f.com/ned/cisco-ios-xr">
          <trap>debugging</trap>
          <monitor>debugging</monitor>
          <buffered>
            <type>informational</type>
          </buffered>
          <host>
            <address>1.2.3.4</address>
            <vrf>default</vrf>
            <severity>info</severity>
            <port>default</port>
          </host>
        </logging> 
      </config>

One thing that helps figure these types of things out is to go to a device that has the configuration you want and issue command like:

show running-configuration | display xml

regards

Richard

View solution in original post

Highlighted
Beginner

Dear RichardD2,

very good. now, i am able to synchronize template and device cli. show run | display xml on device made the trick.

many thanks.