napalm-automation / napalm

Network Automation and Programmability Abstraction Layer with Multivendor support
Apache License 2.0
2.26k stars 555 forks source link

Inconsistencies between nxos and nxos-ssh driver for get_facts() #477

Closed ktbyers closed 6 years ago

ktbyers commented 7 years ago

get_facts() on nxos_ssh returns abbreviated interface (from show ip int brief); nx-api returns canonical interface names.

Also model results differs between the two.

FloLaco commented 6 years ago

Reminder of what is different between two

on nxos : "hostname": "XXXX", on nxos_ssh : "hostname": "XXXX.YYY.YYY.YYY.YYY",

on nxos : "model": "Nexus 3048 Chassis", on nxos_ssh : "model": "Nexus",

on nxos : "os_version": "7.0(3)I4(7)", on nxos_ssh : "os_version": "",

and interface name different too

ktbyers commented 6 years ago

@Rian83 Can you post the output for these four commands from that device above:

show_hostname.txt
show_hosts.txt
show_interface_status.txt
show_version.txt

Note, the model and os_version looks like a bug on NXOS_SSH.

You will also have to provide more details on interface name different too

FloLaco commented 6 years ago

@ktbyers Yes version is a bug which I fixed. I'll do a PR on that. For model also because some has (brackets) at the end (for sup module) and some don't.

And here's my equipment. I discover that N3K and N9K does not have the same CLI output (as usual :( )

XXX# sh hostname 
XXX.y.z.a.com 

XXX# show hosts
DNS lookup enabled
Vrf Name: default Default domain is y.z.a.com
Name servers are   10.48.160.1 10.48.184.1

Host            Address

XXX# sh ver
Cisco Nexus Operating System (NX-OS) Software
TAC support: http://www.cisco.com/tac
Copyright (C) 2002-2017, Cisco and/or its affiliates.
All rights reserved.
The copyrights to certain works contained in this software are
owned by other third parties and used and distributed under their own
licenses, such as open source.  This software is provided "as is," and unless
otherwise stated, there is no warranty, express or implied, including but not
limited to warranties of merchantability and fitness for a particular purpose.
Certain components of this software are licensed under
the GNU General Public License (GPL) version 2.0 or 
GNU General Public License (GPL) version 3.0  or the GNU
Lesser General Public License (LGPL) Version 2.1 or 
Lesser General Public License (LGPL) Version 2.0. 
A copy of each such license is available at
http://www.opensource.org/licenses/gpl-2.0.php and
http://opensource.org/licenses/gpl-3.0.html and
http://www.opensource.org/licenses/lgpl-2.1.php and
http://www.gnu.org/licenses/old-licenses/library.txt.

Software
  BIOS: version 4.0.0
  NXOS: version 7.0(3)I4(7)
  BIOS compile time:  12/05/2016
  NXOS image file is: bootflash:///nxos.7.0.3.I4.7.bin
  NXOS compile time:  6/28/2017 14:00:00 [06/28/2017 23:53:29]

Hardware
  cisco Nexus 3048 Chassis 
  Intel(R) Celeron(R) CPU        P4505  @ 1.87GHz with 3903332 kB of memory.
  Processor Board ID FOC21271RLM

  Device name: XXX
  bootflash:    1848240 kB
  usb1:               0 kB (expansion flash)

Kernel uptime is 50 day(s), 2 hour(s), 29 minute(s), 50 second(s)

Last reset at 829281 usecs after  Thu Oct 26 20:25:34 2017

  Reason: Reset Requested by CLI command reload
  System version: 7.0(3)I4(7)
  Service: 

plugin
  Core Plugin, Ethernet Plugin
FloLaco commented 6 years ago

I've installed titanium NXOSv for test on another plateform. My NXOS json :

{
  "uptime": 3863, 
  "vendor": "Cisco", 
  "hostname": "SWITCH_NXOSv", 
  "fqdn": "SWITCH_NXOSv.y.z.a.com", 
  "os_version": "7.3(0)D1(1)", 
  "serial_number": "TM000B0000B", 
  "model": "NX-OSv Chassis", 
  "interface_list": [
    "mgmt0", 
    "Ethernet2/1", 
    "Ethernet2/2", 
    "Ethernet2/3", 
    "Ethernet2/4", 
    "Ethernet2/5", 
    ...
    "Ethernet4/48"
  ]
}

My show CLI :

SWITCH_NXOSv# sh hostname 
SWITCH_NXOSv.y.z.a.com 
SWITCH_NXOSv# sh hosts
DNS lookup enabled
Vrf Name: default Default domain is y.z.a.com
Name servers are   8.8.8.4 8.8.8.8

Host            Address
SWITCH_NXOSv# sh ver
Cisco Nexus Operating System (NX-OS) Software
TAC support: http://www.cisco.com/tac
Documents: http://www.cisco.com/en/US/products/ps9372/tsd_products_support_series_home.html
Copyright (c) 2002-2016, Cisco Systems, Inc. All rights reserved.
The copyrights to certain works contained herein are owned by
other third parties and are used and distributed under license.
Some parts of this software are covered under the GNU Public
License. A copy of the license is available at
http://www.gnu.org/licenses/gpl.html.

NX-OSv is a demo version of the Nexus Operating System

Software
  loader:    version N/A
  kickstart: version 7.3(0)D1(1)
  system:    version 7.3(0)D1(1)
  kickstart image file is: bootflash:///titanium-d1-kickstart.7.3.0.D1.1.bin
  kickstart compile time:  1/11/2016 16:00:00 [02/11/2016 10:30:12]
  system image file is:    bootflash:///titanium-d1.7.3.0.D1.1.bin
  system compile time:     1/11/2016 16:00:00 [02/11/2016 13:08:11]

Hardware
  cisco NX-OSv Chassis ("NX-OSv Supervisor Module")
  QEMU Virtual CPU version 1.0 with 4012632 kB of memory.
  Processor Board ID TM000B0000B

  Device name: SWITCH_NXOSv
  bootflash:    3184776 kB

Kernel uptime is 0 day(s), 1 hour(s), 1 minute(s), 8 second(s)

plugin
  Core Plugin, Ethernet Plugin

Active Package(s)
SWITCH_NXOSv# sh int st

--------------------------------------------------------------------------------
Port             Name            Status    Vlan      Duplex  Speed   Type
--------------------------------------------------------------------------------
mgmt0            --              connected routed    full    a-1000  --         
Eth2/1           --              disabled  routed    auto    auto               
Eth2/2           --              disabled  routed    auto    auto               
Eth2/3           --              disabled  routed    auto    auto               
...
Eth4/48          --              disabled  routed    auto    auto               
SWITCH_NXOSv# 
FloLaco commented 6 years ago

@ktbyers Should we produce the same napalm output for nxos and nxos_ssh drivers ? Because, for example, show hostname is showing our fqdn on the CLI but the API not.