Skip to content

Commit a3781b8

Browse files
committed
Improve nxos_ssh version handling
Closes #2151
1 parent d0d2a3e commit a3781b8

File tree

7 files changed

+238
-1
lines changed

7 files changed

+238
-1
lines changed

napalm/nxos_ssh/nxos_ssh.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -621,7 +621,7 @@ def get_facts(self):
621621
_, uptime_str = line.split(" uptime is ")
622622
uptime = self.parse_uptime(uptime_str)
623623

624-
if "system: " in line or "NXOS: " in line:
624+
if "system: " in line or line.strip().startswith("NXOS: version"):
625625
line = line.strip()
626626
os_version = line.split()[2]
627627
os_version = os_version.strip()
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
{
2+
"os_version": "10.3(5)",
3+
"uptime": 4338547,
4+
"interface_list": [
5+
"Management0",
6+
"Ethernet1/1",
7+
"Ethernet1/2",
8+
"Ethernet1/3",
9+
"Ethernet1/4",
10+
"Ethernet1/5",
11+
"Ethernet1/6",
12+
"Ethernet1/7",
13+
"Ethernet1/8",
14+
"Ethernet1/9",
15+
"Ethernet1/10",
16+
"Ethernet1/11",
17+
"Ethernet1/12",
18+
"Ethernet1/13",
19+
"Ethernet1/14",
20+
"Ethernet1/15",
21+
"Ethernet1/16",
22+
"Ethernet1/17",
23+
"Ethernet1/18",
24+
"Ethernet1/19",
25+
"Ethernet1/20",
26+
"Ethernet1/21",
27+
"Ethernet1/22",
28+
"Ethernet1/23",
29+
"Ethernet1/24",
30+
"Ethernet1/25",
31+
"Ethernet1/26",
32+
"Ethernet1/27",
33+
"Ethernet1/28",
34+
"Ethernet1/29",
35+
"Ethernet1/30",
36+
"Ethernet1/31",
37+
"Ethernet1/32",
38+
"Ethernet1/33",
39+
"Ethernet1/34",
40+
"Ethernet1/35",
41+
"Ethernet1/36",
42+
"Ethernet1/37",
43+
"Ethernet1/38",
44+
"Ethernet1/39",
45+
"Ethernet1/40",
46+
"Ethernet1/41",
47+
"Ethernet1/42",
48+
"Ethernet1/43",
49+
"Ethernet1/44",
50+
"Ethernet1/45",
51+
"Ethernet1/46",
52+
"Ethernet1/47",
53+
"Ethernet1/48",
54+
"Ethernet1/49",
55+
"Ethernet1/50",
56+
"Ethernet1/51",
57+
"Ethernet1/52",
58+
"Port-channel1",
59+
"Port-channel16",
60+
"Port-channel17",
61+
"Port-channel32",
62+
"Port-channel33",
63+
"Port-channel34",
64+
"Port-channel35",
65+
"Port-channel50",
66+
"Port-channel51",
67+
"Port-channel360",
68+
"Vlan1",
69+
"Vlan351"
70+
],
71+
"vendor": "Cisco",
72+
"serial_number": "TM6012EC74B",
73+
"model": "Nexus 3048 Chassis",
74+
"hostname": "SWITCH_NXOSv",
75+
"fqdn": "SWITCH_NXOSv.y.z.a.com"
76+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
SWITCH_NXOSv.y.z.a.com
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
DNS lookup enabled
2+
Vrf Name: default Default domain is y.z.a.com
3+
Name servers are 8.8.8.4 8.8.8.8
4+
5+
6+
7+
Host Address
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
2+
--------------------------------------------------------------------------------
3+
Port Name Status Vlan Duplex Speed Type
4+
--------------------------------------------------------------------------------
5+
mgmt0 -- connected routed full 1000 --
6+
Eth1/1 -- connected 353 full 100 10/100/1g
7+
Eth1/2 -- notconnec 353 auto auto 10/100/1g
8+
Eth1/3 -- disabled 366 auto auto 10/100/1g
9+
Eth1/4 -- connected 351 full 1000 10/100/1g
10+
Eth1/5 -- connected 351 full 1000 10/100/1g
11+
Eth1/6 -- connected 351 full 1000 10/100/1g
12+
Eth1/7 -- connected 351 full 1000 10/100/1g
13+
Eth1/8 -- connected 351 full 1000 10/100/1g
14+
Eth1/9 -- connected 351 full 1000 10/100/1g
15+
Eth1/10 -- connected 351 full 1000 10/100/1g
16+
Eth1/11 -- connected 351 full 1000 10/100/1g
17+
Eth1/12 -- connected 351 full 1000 10/100/1g
18+
Eth1/13 -- connected 351 full 1000 10/100/1g
19+
Eth1/14 -- connected 351 full 1000 10/100/1g
20+
Eth1/15 -- connected 351 full 1000 10/100/1g
21+
Eth1/16 -- connected trunk full 1000 10/100/1g
22+
Eth1/17 -- connected trunk full 1000 10/100/1g
23+
Eth1/18 -- connected 369 full 1000 10/100/1g
24+
Eth1/19 -- notconnec 351 auto auto 10/100/1g
25+
Eth1/20 -- connected 351 full 100 10/100/1g
26+
Eth1/21 -- connected 351 half 100 10/100/1g
27+
Eth1/22 -- connected 351 half 100 10/100/1g
28+
Eth1/23 -- disabled 366 auto auto 10/100/1g
29+
Eth1/24 -- connected 352 full 1000 10/100/1g
30+
Eth1/25 -- connected 352 half 100 10/100/1g
31+
Eth1/26 -- connected 352 full 1000 10/100/1g
32+
Eth1/27 -- connected 352 half 100 10/100/1g
33+
Eth1/28 -- connected 352 full 100 10/100/1g
34+
Eth1/29 -- connected 352 full 100 10/100/1g
35+
Eth1/30 -- connected 352 full 100 10/100/1g
36+
Eth1/31 -- disabled 366 auto auto 10/100/1g
37+
Eth1/32 -- connected trunk full 1000 10/100/1g
38+
Eth1/33 -- connected trunk full 1000 10/100/1g
39+
Eth1/34 -- connected trunk full 1000 10/100/1g
40+
Eth1/35 -- connected trunk full 1000 10/100/1g
41+
Eth1/36 -- connected 351 full 1000 10/100/1g
42+
Eth1/37 -- connected 351 full 1000 10/100/1g
43+
Eth1/38 -- connected 351 full 1000 10/100/1g
44+
Eth1/39 -- connected 351 full 1000 10/100/1g
45+
Eth1/40 -- connected 351 full 1000 10/100/1g
46+
Eth1/41 -- disabled 350 auto auto 10/100/1g
47+
Eth1/42 -- connected 351 full 1000 10/100/1g
48+
Eth1/43 -- connected 351 full 1000 10/100/1g
49+
Eth1/44 -- connected 351 full 1000 10/100/1g
50+
Eth1/45 -- connected 351 full 1000 10/100/1g
51+
Eth1/46 -- disabled 366 auto auto 10/100/1g
52+
Eth1/47 -- connected trunk full 1000 10/100/1g
53+
Eth1/48 -- connected trunk full 1000 10/100/1g
54+
Eth1/49 -- xcvrAbsen 366 full 10G --
55+
Eth1/50 -- connected trunk full 1000 1000base-SX
56+
Eth1/51 -- connected trunk full 1000 1000base-SX
57+
Eth1/52 -- connected trunk full 1000 1000base-SX
58+
Po1 -- connected trunk full 1000 --
59+
Po16 -- connected trunk full 1000 --
60+
Po17 -- connected trunk full 1000 --
61+
Po32 -- connected trunk full 1000 --
62+
Po33 -- connected trunk full 1000 --
63+
Po34 -- connected trunk full 1000 --
64+
Po35 -- connected trunk full 1000 --
65+
Po50 -- connected trunk full 1000 --
66+
Po51 -- connected trunk full 1000 --
67+
Po360 -- connected trunk full 1000 --
68+
Vlan1 -- down routed auto auto --
69+
Vlan351 -- connected routed auto auto --
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
{
2+
"TABLE_inv": {
3+
"ROW_inv": [
4+
{
5+
"name": "Chassis",
6+
"desc": "Nexus 6001 Chassis",
7+
"productid": "N6K-C6001-64P",
8+
"vendorid": "V01",
9+
"serialnum": "TM6012EC74B"
10+
},
11+
{
12+
"name": "Module 1",
13+
"desc": "Nexus 64 Supervisor",
14+
"productid": "N6K-C6001-64P",
15+
"vendorid": "V01",
16+
"serialnum": "FOC11111111"
17+
},
18+
{
19+
"name": "Module 2",
20+
"desc": "Nexus 4xQSFP Ethernet Module",
21+
"productid": "N6K-C6001-M4Q",
22+
"vendorid": "V01",
23+
"serialnum": "FOC11111111"
24+
},
25+
{
26+
"name": "Fan 1",
27+
"desc": "Chassis fan module",
28+
"productid": "N6K-C6001-FAN-B",
29+
"vendorid": "N/A",
30+
"serialnum": "N/A"
31+
}
32+
]
33+
}
34+
}
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
Cisco Nexus Operating System (NX-OS) Software
2+
TAC support: http://www.cisco.com/tac
3+
Copyright (C) 2002-2017, Cisco and/or its affiliates.
4+
All rights reserved.
5+
The copyrights to certain works contained in this software are
6+
owned by other third parties and used and distributed under their own
7+
licenses, such as open source. This software is provided "as is," and unless
8+
otherwise stated, there is no warranty, express or implied, including but not
9+
limited to warranties of merchantability and fitness for a particular purpose.
10+
Certain components of this software are licensed under
11+
the GNU General Public License (GPL) version 2.0 or
12+
GNU General Public License (GPL) version 3.0 or the GNU
13+
Lesser General Public License (LGPL) Version 2.1 or
14+
Lesser General Public License (LGPL) Version 2.0.
15+
A copy of each such license is available at
16+
http://www.opensource.org/licenses/gpl-2.0.php and
17+
http://opensource.org/licenses/gpl-3.0.html and
18+
http://www.opensource.org/licenses/lgpl-2.1.php and
19+
http://www.gnu.org/licenses/old-licenses/library.txt.
20+
21+
Software
22+
BIOS: version 01.09
23+
NXOS: version 10.3(5) [Maintenance Release]
24+
Host NXOS: version 10.3(5)
25+
BIOS compile time: 10/08/2023
26+
NXOS image file is: bootflash:///nxos64-cs.10.3.5.M.bin
27+
NXOS compile time: 4/30/2024 12:00:00 [05/08/2024 05:39:13]
28+
NXOS boot mode: LXC
29+
30+
Hardware
31+
cisco Nexus 3048 Chassis
32+
Intel(R) Celeron(R) CPU P4505 @ 1.87GHz with 3903332 kB of memory.
33+
Processor Board ID TM6012EC74B
34+
35+
Device name: SWITCH_NXOSv
36+
bootflash: 1848240 kB
37+
usb1: 0 kB (expansion flash)
38+
39+
Kernel uptime is 50 day(s), 5 hour(s), 9 minute(s), 7 second(s)
40+
41+
Last reset at 829281 usecs after Thu Oct 26 20:25:34 2017
42+
43+
Reason: Reset Requested by CLI command reload
44+
System version: 7.0(3)I4(7)
45+
Service:
46+
47+
plugin
48+
Core Plugin, Ethernet Plugin
49+
50+
Active Package(s):

0 commit comments

Comments
 (0)