Lab 05 - Exploring NAPALM and Netmiko Task Modules to Gather Data¶
This lab is going to show how to gather data using the NAPALM and Netmiko plugins. They will SSH and interact directly with the devices defined in the inventory.
The print_result and print_title functions will also be imported in these steps as they will help print out the results of each task.
Task 1 - Gather Device Facts using NAPALM¶
The napalm_get module is used in this task. This module will gather device facts and return the data in a structured format.
The advantage of returning structured data is that it can now be consumed by software easier than returning data in text format that would require a parser like TextFSM to parse out specific data.
Step 1¶
Make sure you're in the /home/ntc/nornir folder and create a file named nr_napalm.py.
Step 2¶
Import all the needed libraries. The main libraries imported will be to initialize Nornir, napalm_get to gather structured facts from the devices, print_result, and print_title to have a nicely formatted output of the result and get feedback if there was a change or failure in the run and the filter object to filter out a group of devices. Finally, initialize Nornir by using the NAPALM configuration file and inventory set up in previous labs.
Add the following code to the nr_napalm.py file and save it:
from nornir import InitNornir
from nornir_napalm.plugins.tasks import napalm_get
from nornir_utils.plugins.functions import print_result, print_title
from nornir.core.filter import F
from rich import print
nr = InitNornir(config_file="nornir_configuration/napalm_configuration.yml")
Step 3¶
First, execute the nr_napalm.py file in a new interactive Python shell (notice the -i parameter). Then, create a variable called get_data and use the run function inside the nr object so that any task will target all the devices initialized in the nr object.
Inside the run function as arguments, use task with a value of the module napalm_get and getters with a value of a list containing the string of facts.
ntc@ntc-training:nornir$ python -i nr_napalm.py
>>>
>>> get_data = nr.run(task=napalm_get, getters=['facts'])
>>>
Step 4¶
Use the print function to print out the get_data variable. The output of this variable returns an "AggregatedResult" object in the form of a dictionary.
Printing the keys will return the devices targeted in the task, and printing the values will return the result of each device from the task.
>>>
>>> print(get_data)
AggregatedResult (napalm_get): {'csr1': MultiResult: [Result: "napalm_get"], 'csr2': MultiResult: [Result: "napalm_get"], 'csr3':
MultiResult: [Result: "napalm_get"], 'nxos-spine1': MultiResult: [Result: "napalm_get"], 'nxos-spine2': MultiResult: [Result:
"napalm_get"], 'eos-leaf1': MultiResult: [Result: "napalm_get"], 'eos-leaf2': MultiResult: [Result: "napalm_get"], 'eos-spine1':
MultiResult: [Result: "napalm_get"], 'eos-spine2': MultiResult: [Result: "napalm_get"]}
>>>
>>> print(type(get_data))
nornir.core.task.AggregatedResult
>>>
>>> print(get_data.keys())
dict_keys(['csr1', 'csr2', 'csr3', 'nxos-spine1', 'nxos-spine2', 'eos-leaf1', 'eos-leaf2', 'eos-spine1', 'eos-spine2'])
>>>
>>> print(get_data.values())
dict_values([MultiResult: [Result: "napalm_get"], MultiResult: [Result: "napalm_get"], MultiResult: [Result: "napalm_get"],
MultiResult: [Result: "napalm_get"], MultiResult: [Result: "napalm_get"], MultiResult: [Result: "napalm_get"], MultiResult:
[Result: "napalm_get"], MultiResult: [Result: "napalm_get"], MultiResult: [Result: "napalm_get"]])
>>>
Step 5¶
As seen on the previous task just using the print function will not display the results task.
Use the print_result function to print out the results of get_data. The output comes out as changed False since there was no change on the device; it only gathered data.
>>>
>>> print_result(get_data)
napalm_get**********************************************************************
* csr1 ** changed : False ******************************************************
vvvv napalm_get ** changed : False vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv INFO
{ 'facts': { 'fqdn': 'csr1.ntc.com',
'hostname': 'csr1',
'interface_list': [ 'GigabitEthernet1',
'GigabitEthernet2',
'GigabitEthernet3',
'GigabitEthernet4',
'GigabitEthernet5',
'GigabitEthernet6',
'GigabitEthernet7',
'GigabitEthernet8',
'GigabitEthernet9'],
'model': 'CSR1000V',
'os_version': 'Virtual XE Software '
'(X86_64_LINUX_IOSD-UNIVERSALK9-M), Version 17.1.1, '
'RELEASE SOFTWARE (fc3)',
'serial_number': '9SAGBHTUEE9',
'uptime': 516120,
'vendor': 'Cisco'}}
^^^^ END napalm_get ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
* csr2 ** changed : False ******************************************************
vvvv napalm_get ** changed : False vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv INFO
{ 'facts': { 'fqdn': 'csr2.ntc.com',
'hostname': 'csr2',
'interface_list': [ 'GigabitEthernet1',
'GigabitEthernet2',
'GigabitEthernet3',
'GigabitEthernet4',
'GigabitEthernet5',
'GigabitEthernet6',
'GigabitEthernet7',
'GigabitEthernet8',
'GigabitEthernet9'],
'model': 'CSR1000V',
'os_version': 'Virtual XE Software '
'(X86_64_LINUX_IOSD-UNIVERSALK9-M), Version 17.1.1, '
'RELEASE SOFTWARE (fc3)',
'serial_number': '9SAGBHTUEE9',
'uptime': 516120,
'vendor': 'Cisco'}}
^^^^ END napalm_get ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
* csr3 ** changed : False ******************************************************
vvvv napalm_get ** changed : False vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv INFO
{ 'facts': { 'fqdn': 'csr3.ntc.com',
'hostname': 'csr3',
'interface_list': [ 'GigabitEthernet1',
'GigabitEthernet2',
'GigabitEthernet3',
'GigabitEthernet4',
'GigabitEthernet5',
'GigabitEthernet6',
'GigabitEthernet7',
'GigabitEthernet8',
'GigabitEthernet9'],
'model': 'CSR1000V',
'os_version': 'Virtual XE Software '
'(X86_64_LINUX_IOSD-UNIVERSALK9-M), Version 17.1.1, '
'RELEASE SOFTWARE (fc3)',
'serial_number': '9SAGBHTUEE9',
'uptime': 516120,
'vendor': 'Cisco'}}
^^^^ END napalm_get ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
* eos-leaf1 ** changed : False *************************************************
vvvv napalm_get ** changed : False vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv INFO
{ 'facts': { 'fqdn': 'eos-leaf1.ntc.com',
'hostname': 'eos-leaf1',
'interface_list': [ 'Ethernet1',
'Ethernet2',
'Ethernet3',
'Ethernet4',
'Ethernet5',
'Ethernet6',
'Ethernet7',
'Ethernet8',
'Ethernet9',
'Ethernet10',
'Ethernet11',
'Ethernet12',
'Ethernet13',
'Ethernet14',
'Ethernet15',
'Ethernet16',
'Ethernet17',
'Ethernet18',
'Ethernet19',
'Management1'],
'model': 'vEOS',
'os_version': '4.22.4M-15583082.4224M',
'serial_number': '',
'uptime': 515637,
'vendor': 'Arista'}}
^^^^ END napalm_get ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
* eos-leaf2 ** changed : False *************************************************
vvvv napalm_get ** changed : False vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv INFO
{ 'facts': { 'fqdn': 'eos-leaf2.ntc.com',
'hostname': 'eos-leaf2',
'interface_list': [ 'Ethernet1',
'Ethernet2',
'Ethernet3',
'Ethernet4',
'Ethernet5',
'Ethernet6',
'Ethernet7',
'Ethernet8',
'Ethernet9',
'Ethernet10',
'Ethernet11',
'Ethernet12',
'Ethernet13',
'Ethernet14',
'Ethernet15',
'Ethernet16',
'Ethernet17',
'Ethernet18',
'Ethernet19',
'Management1'],
'model': 'vEOS',
'os_version': '4.22.4M-15583082.4224M',
'serial_number': '',
'uptime': 515634,
'vendor': 'Arista'}}
^^^^ END napalm_get ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
* eos-spine1 ** changed : False ************************************************
vvvv napalm_get ** changed : False vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv INFO
{ 'facts': { 'fqdn': 'eos-spine1.ntc.com',
'hostname': 'eos-spine1',
'interface_list': [ 'Ethernet1',
'Ethernet2',
'Ethernet3',
'Ethernet4',
'Ethernet5',
'Ethernet6',
'Ethernet7',
'Ethernet8',
'Ethernet9',
'Ethernet10',
'Ethernet11',
'Ethernet12',
'Ethernet13',
'Ethernet14',
'Ethernet15',
'Ethernet16',
'Ethernet17',
'Ethernet18',
'Ethernet19',
'Management1'],
'model': 'vEOS',
'os_version': '4.22.4M-15583082.4224M',
'serial_number': '',
'uptime': 515634,
'vendor': 'Arista'}}
^^^^ END napalm_get ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
* eos-spine2 ** changed : False ************************************************
vvvv napalm_get ** changed : False vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv INFO
{ 'facts': { 'fqdn': 'eos-spine2.ntc.com',
'hostname': 'eos-spine2',
'interface_list': [ 'Ethernet1',
'Ethernet2',
'Ethernet3',
'Ethernet4',
'Ethernet5',
'Ethernet6',
'Ethernet7',
'Ethernet8',
'Ethernet9',
'Ethernet10',
'Ethernet11',
'Ethernet12',
'Ethernet13',
'Ethernet14',
'Ethernet15',
'Ethernet16',
'Ethernet17',
'Ethernet18',
'Ethernet19',
'Management1'],
'model': 'vEOS',
'os_version': '4.22.4M-15583082.4224M',
'serial_number': '',
'uptime': 515634,
'vendor': 'Arista'}}
^^^^ END napalm_get ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
* nxos-spine1 ** changed : False ***********************************************
vvvv napalm_get ** changed : False vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv INFO
{ 'facts': { 'fqdn': 'nxos-spine1.ntc.com',
'hostname': 'nxos-spine1',
'interface_list': [ 'Management0',
'Ethernet1/1',
'Ethernet1/2',
'Ethernet1/3',
'Ethernet1/4',
'Ethernet1/5',
'Ethernet1/6',
'Ethernet1/7',
'Ethernet1/8',
'Ethernet1/9',
'Ethernet1/10',
'Ethernet1/11',
'Ethernet1/12',
'Ethernet1/13',
'Ethernet1/14',
'Ethernet1/15',
'Ethernet1/16',
'Ethernet1/17',
'Ethernet1/18',
'Ethernet1/19',
'Ethernet1/20',
'Ethernet1/21',
'Ethernet1/22',
'Ethernet1/23',
'Ethernet1/24',
'Ethernet1/25',
'Ethernet1/26',
'Ethernet1/27',
'Ethernet1/28',
'Ethernet1/29',
'Ethernet1/30',
'Ethernet1/31',
'Ethernet1/32',
'Ethernet1/33',
'Ethernet1/34',
'Ethernet1/35',
'Ethernet1/36',
'Ethernet1/37',
'Ethernet1/38',
'Ethernet1/39',
'Ethernet1/40',
'Ethernet1/41',
'Ethernet1/42',
'Ethernet1/43',
'Ethernet1/44',
'Ethernet1/45',
'Ethernet1/46',
'Ethernet1/47',
'Ethernet1/48',
'Ethernet1/49',
'Ethernet1/50',
'Ethernet1/51',
'Ethernet1/52',
'Ethernet1/53',
'Ethernet1/54',
'Ethernet1/55',
'Ethernet1/56',
'Ethernet1/57',
'Ethernet1/58',
'Ethernet1/59',
'Ethernet1/60',
'Ethernet1/61',
'Ethernet1/62',
'Ethernet1/63',
'Ethernet1/64',
'Vlan1'],
'model': 'Nexus9000 C9300v Chassis',
'os_version': '9.3(3)',
'serial_number': '9X487AEJUEE',
'uptime': 516009,
'vendor': 'Cisco'}}
^^^^ END napalm_get ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
* nxos-spine2 ** changed : False ***********************************************
vvvv napalm_get ** changed : False vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv INFO
{ 'facts': { 'fqdn': 'nxos-spine2.ntc.com',
'hostname': 'nxos-spine2',
'interface_list': [ 'Management0',
'Ethernet1/1',
'Ethernet1/2',
'Ethernet1/3',
'Ethernet1/4',
'Ethernet1/5',
'Ethernet1/6',
'Ethernet1/7',
'Ethernet1/8',
'Ethernet1/9',
'Ethernet1/10',
'Ethernet1/11',
'Ethernet1/12',
'Ethernet1/13',
'Ethernet1/14',
'Ethernet1/15',
'Ethernet1/16',
'Ethernet1/17',
'Ethernet1/18',
'Ethernet1/19',
'Ethernet1/20',
'Ethernet1/21',
'Ethernet1/22',
'Ethernet1/23',
'Ethernet1/24',
'Ethernet1/25',
'Ethernet1/26',
'Ethernet1/27',
'Ethernet1/28',
'Ethernet1/29',
'Ethernet1/30',
'Ethernet1/31',
'Ethernet1/32',
'Ethernet1/33',
'Ethernet1/34',
'Ethernet1/35',
'Ethernet1/36',
'Ethernet1/37',
'Ethernet1/38',
'Ethernet1/39',
'Ethernet1/40',
'Ethernet1/41',
'Ethernet1/42',
'Ethernet1/43',
'Ethernet1/44',
'Ethernet1/45',
'Ethernet1/46',
'Ethernet1/47',
'Ethernet1/48',
'Ethernet1/49',
'Ethernet1/50',
'Ethernet1/51',
'Ethernet1/52',
'Ethernet1/53',
'Ethernet1/54',
'Ethernet1/55',
'Ethernet1/56',
'Ethernet1/57',
'Ethernet1/58',
'Ethernet1/59',
'Ethernet1/60',
'Ethernet1/61',
'Ethernet1/62',
'Ethernet1/63',
'Ethernet1/64',
'Vlan1'],
'model': 'Nexus9000 C9300v Chassis',
'os_version': '9.3(3)',
'serial_number': '9X487AEJUEE',
'uptime': 516010,
'vendor': 'Cisco'}}
^^^^ END napalm_get ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>>>
Step 6¶
Since data can't be accessed directly through the print_result function and "AggregatedResult" returns a dictionary, the items() function can be used to extract the results and access all the keys from the output.
Use a for loop to iterate through each key and value using the items() function and create a variable to access the results of each host to a specified key. In this step, access each vendor, os_version, and model keys.
After the value of each key has been accessed, print out each variable using f-strings so that it prints out in a nicely formatted fashion.
>>>
>>> for host, facts in get_data.items():
... vendor = get_data[host].result['facts']['vendor']
... os_version = get_data[host].result['facts']['os_version']
... model = get_data[host].result['facts']['model']
... print(f"Host: {host}")
... print(f"Vendor: {vendor}")
... print(f"OS Version: {os_version}")
... print(f"Devic Model: {model}\n")
...
Host: csr1
Vendor: Cisco
OS Version: Virtual XE Software (X86_64_LINUX_IOSD-UNIVERSALK9-M), Version 17.1.1, RELEASE SOFTWARE (fc3)
Devic Model: CSR1000V
Host: csr2
Vendor: Cisco
OS Version: Virtual XE Software (X86_64_LINUX_IOSD-UNIVERSALK9-M), Version 17.1.1, RELEASE SOFTWARE (fc3)
Devic Model: CSR1000V
Host: csr3
Vendor: Cisco
OS Version: Virtual XE Software (X86_64_LINUX_IOSD-UNIVERSALK9-M), Version 17.1.1, RELEASE SOFTWARE (fc3)
Devic Model: CSR1000V
Host: nxos-spine1
Vendor: Cisco
OS Version: 9.3(3)
Devic Model: Nexus9000 C9300v Chassis
Host: nxos-spine2
Vendor: Cisco
OS Version: 9.3(3)
Devic Model: Nexus9000 C9300v Chassis
Host: eos-leaf1
Vendor: Arista
OS Version: 4.22.4M-15583082.4224M
Devic Model: vEOS
Host: eos-leaf2
Vendor: Arista
OS Version: 4.22.4M-15583082.4224M
Devic Model: vEOS
Host: eos-spine1
Vendor: Arista
OS Version: 4.22.4M-15583082.4224M
Devic Model: vEOS
Host: eos-spine2
Vendor: Arista
OS Version: 4.22.4M-15583082.4224M
Devic Model: vEOS
>>>
Step 7¶
Use the filter function to filter out the iosxe group.
Step 8¶
Create a new variable with a value using the iosxe group and run the task napalm_get. This time rather than gathering device facts, in the getters, the value will be "config" and use the retrieve argument to return the running-config.
>>>
>>> gather_running_config = iosxe.run(
task=napalm_get,
getters=['config'],
retrieve="running",
name="RETURN RUNNING CONFIG"
)
>>>
Step 9¶
Use the print_result function to view the results of the task. Similar to step six the output of the running configuration can be used for backing up the devices to a file.
>>>
>>> print_result(gather_running_config)
RETURN RUNNING CONFIG***********************************************************
* csr1 ** changed : False ******************************************************
vvvv RETURN RUNNING CONFIG ** changed : False vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv INFO
{ 'config': { 'candidate': '',
'running': '!\n'
'\n'
'!\n'
'version 17.1\n'
'service timestamps debug datetime msec\n'
'service timestamps log datetime msec\n'
'! Call-home is enabled by Smart-Licensing.\n'
'service call-home\n'
'platform qfp utilization monitor load 80\n'
'platform punt-keepalive disable-kernel-core\n'
'platform console serial\n'
'!\n'
'hostname csr1\n'
'!\n'
'boot-start-marker\n'
'boot-end-marker\n'
'!\n'
'!\n'
'vrf definition MANAGEMENT\n'
' !\n'
' address-family ipv4\n'
' exit-address-family\n'
' !\n'
' address-family ipv6\n'
' exit-address-family\n'
--- OUTPUT OMITTED ---
^^^^ END RETURN RUNNING CONFIG ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>>>
Task 2 - Sending Operational Commands using NAPALM¶
Another way of gathering data from networking devices is by sending operational commands using the traditional CLI. The napalm_cli module can be used to send a single or a list of commands.
The commands sent to the remote device needs to be supported by the networking device OS. The response output will return inside the command input as a key and as a value the string or text format of the response.
Step 1¶
Import the napalm_cli module and create a variable named show_version. For the value of that variable, use the iosxe object and run the napalm_cli module with an argument of commands sending a single list element of "show version."
>>>
>>> from nornir_napalm.plugins.tasks import napalm_cli
>>>
>>> show_version = iosxe.run(napalm_cli, commands=["show version"])
>>>
Step 2¶
Use the print_result function to view the output result of the command sent.
>>>
>>> print_result(show_version)
napalm_cli**********************************************************************
* csr1 ** changed : False ******************************************************
vvvv napalm_cli ** changed : False vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv INFO
{ 'show version': 'Cisco IOS XE Software, Version 17.01.01\n'
'Cisco IOS Software [Amsterdam], Virtual XE Software '
'(X86_64_LINUX_IOSD-UNIVERSALK9-M), Version 17.1.1, RELEASE '
'SOFTWARE (fc3)\n'
'Technical Support: http://www.cisco.com/techsupport\n'
'Copyright (c) 1986-2019 by Cisco Systems, Inc.\n'
'Compiled Fri 22-Nov-19 03:39 by mcpre\n'
'\n'
'\n'
'Cisco IOS-XE software, Copyright (c) 2005-2019 by cisco '
'Systems, Inc.\n'
'All rights reserved. Certain components of Cisco IOS-XE '
'software are\n'
'licensed under the GNU General Public License ("GPL") '
'Version 2.0. The\n'
'software code licensed under GPL Version 2.0 is free '
'software that comes\n'
'with ABSOLUTELY NO WARRANTY. You can redistribute and/or '
'modify such\n'
'GPL code under the terms of GPL Version 2.0. For more '
'details, see the\n'
'documentation or "License Notice" file accompanying the '
'IOS-XE software,\n'
'or the applicable URL provided on the flyer accompanying '
'the IOS-XE\n'
'software.\n'
'\n'
'\n'
'ROM: IOS-XE ROMMON\n'
'\n'
'csr1 uptime is 6 days, 3 hours, 57 minutes\n'
'Uptime for this control processor is 6 days, 3 hours, 58 '
'minutes\n'
'System returned to ROM by reload\n'
'System image file is "bootflash:packages.conf"\n'
'Last reload reason: reload\n'
'\n'
'\n'
'\n'
'This product contains cryptographic features and is subject '
'to United\n'
'States and local country laws governing import, export, '
'transfer and\n'
'use. Delivery of Cisco cryptographic products does not '
'imply\n'
'third-party authority to import, export, distribute or use '
'encryption.\n'
'Importers, exporters, distributors and users are '
'responsible for\n'
'compliance with U.S. and local country laws. By using this '
'product you\n'
'agree to comply with applicable laws and regulations. If '
'you are unable\n'
'to comply with U.S. and local laws, return this product '
'immediately.\n'
'\n'
'A summary of U.S. laws governing Cisco cryptographic '
'products may be found at:\n'
'http://www.cisco.com/wwl/export/crypto/tool/stqrg.html\n'
'\n'
'If you require further assistance please contact us by '
'sending email to\n'
'export@cisco.com.\n'
'\n'
'License Level: ax\n'
'License Type: N/A(Smart License Enabled)\n'
'Next reload license Level: ax\n'
'\n'
'\n'
'Smart Licensing Status: UNREGISTERED/No Licenses in Use\n'
'\n'
'cisco CSR1000V (VXE) processor (revision VXE) with '
'2078006K/3075K bytes of memory.\n'
'Processor board ID 9SAGBHTUEE9\n'
'9 Gigabit Ethernet interfaces\n'
'32768K bytes of non-volatile configuration memory.\n'
'3978444K bytes of physical memory.\n'
'6188032K bytes of virtual hard disk at bootflash:.\n'
'\n'
'Configuration register is 0x2102'}
^^^^ END napalm_cli ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
* csr2 ** changed : False ******************************************************
vvvv napalm_cli ** changed : False vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv INFO
{ 'show version': 'Cisco IOS XE Software, Version 17.01.01\n'
'Cisco IOS Software [Amsterdam], Virtual XE Software '
'(X86_64_LINUX_IOSD-UNIVERSALK9-M), Version 17.1.1, RELEASE '
'SOFTWARE (fc3)\n'
'Technical Support: http://www.cisco.com/techsupport\n'
'Copyright (c) 1986-2019 by Cisco Systems, Inc.\n'
'Compiled Fri 22-Nov-19 03:39 by mcpre\n'
'\n'
'\n'
'Cisco IOS-XE software, Copyright (c) 2005-2019 by cisco '
'Systems, Inc.\n'
'All rights reserved. Certain components of Cisco IOS-XE '
'software are\n'
'licensed under the GNU General Public License ("GPL") '
'Version 2.0. The\n'
'software code licensed under GPL Version 2.0 is free '
'software that comes\n'
'with ABSOLUTELY NO WARRANTY. You can redistribute and/or '
'modify such\n'
'GPL code under the terms of GPL Version 2.0. For more '
'details, see the\n'
'documentation or "License Notice" file accompanying the '
'IOS-XE software,\n'
'or the applicable URL provided on the flyer accompanying '
'the IOS-XE\n'
'software.\n'
'\n'
'\n'
'ROM: IOS-XE ROMMON\n'
'\n'
'csr2 uptime is 6 days, 3 hours, 57 minutes\n'
'Uptime for this control processor is 6 days, 3 hours, 58 '
'minutes\n'
'System returned to ROM by reload\n'
'System image file is "bootflash:packages.conf"\n'
'Last reload reason: reload\n'
'\n'
'\n'
'\n'
'This product contains cryptographic features and is subject '
'to United\n'
'States and local country laws governing import, export, '
'transfer and\n'
'use. Delivery of Cisco cryptographic products does not '
'imply\n'
'third-party authority to import, export, distribute or use '
'encryption.\n'
'Importers, exporters, distributors and users are '
'responsible for\n'
'compliance with U.S. and local country laws. By using this '
'product you\n'
'agree to comply with applicable laws and regulations. If '
'you are unable\n'
'to comply with U.S. and local laws, return this product '
'immediately.\n'
'\n'
'A summary of U.S. laws governing Cisco cryptographic '
'products may be found at:\n'
'http://www.cisco.com/wwl/export/crypto/tool/stqrg.html\n'
'\n'
'If you require further assistance please contact us by '
'sending email to\n'
'export@cisco.com.\n'
'\n'
'License Level: ax\n'
'License Type: N/A(Smart License Enabled)\n'
'Next reload license Level: ax\n'
'\n'
'\n'
'Smart Licensing Status: UNREGISTERED/No Licenses in Use\n'
'\n'
'cisco CSR1000V (VXE) processor (revision VXE) with '
'2078006K/3075K bytes of memory.\n'
'Processor board ID 9SAGBHTUEE9\n'
'9 Gigabit Ethernet interfaces\n'
'32768K bytes of non-volatile configuration memory.\n'
'3978444K bytes of physical memory.\n'
'6188032K bytes of virtual hard disk at bootflash:.\n'
'\n'
'Configuration register is 0x2102'}
^^^^ END napalm_cli ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
* csr3 ** changed : False ******************************************************
vvvv napalm_cli ** changed : False vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv INFO
{ 'show version': 'Cisco IOS XE Software, Version 17.01.01\n'
'Cisco IOS Software [Amsterdam], Virtual XE Software '
'(X86_64_LINUX_IOSD-UNIVERSALK9-M), Version 17.1.1, RELEASE '
'SOFTWARE (fc3)\n'
'Technical Support: http://www.cisco.com/techsupport\n'
'Copyright (c) 1986-2019 by Cisco Systems, Inc.\n'
'Compiled Fri 22-Nov-19 03:39 by mcpre\n'
'\n'
'\n'
'Cisco IOS-XE software, Copyright (c) 2005-2019 by cisco '
'Systems, Inc.\n'
'All rights reserved. Certain components of Cisco IOS-XE '
'software are\n'
'licensed under the GNU General Public License ("GPL") '
'Version 2.0. The\n'
'software code licensed under GPL Version 2.0 is free '
'software that comes\n'
'with ABSOLUTELY NO WARRANTY. You can redistribute and/or '
'modify such\n'
'GPL code under the terms of GPL Version 2.0. For more '
'details, see the\n'
'documentation or "License Notice" file accompanying the '
'IOS-XE software,\n'
'or the applicable URL provided on the flyer accompanying '
'the IOS-XE\n'
'software.\n'
'\n'
'\n'
'ROM: IOS-XE ROMMON\n'
'\n'
'csr3 uptime is 6 days, 3 hours, 57 minutes\n'
'Uptime for this control processor is 6 days, 3 hours, 58 '
'minutes\n'
'System returned to ROM by reload\n'
'System image file is "bootflash:packages.conf"\n'
'Last reload reason: reload\n'
'\n'
'\n'
'\n'
'This product contains cryptographic features and is subject '
'to United\n'
'States and local country laws governing import, export, '
'transfer and\n'
'use. Delivery of Cisco cryptographic products does not '
'imply\n'
'third-party authority to import, export, distribute or use '
'encryption.\n'
'Importers, exporters, distributors and users are '
'responsible for\n'
'compliance with U.S. and local country laws. By using this '
'product you\n'
'agree to comply with applicable laws and regulations. If '
'you are unable\n'
'to comply with U.S. and local laws, return this product '
'immediately.\n'
'\n'
'A summary of U.S. laws governing Cisco cryptographic '
'products may be found at:\n'
'http://www.cisco.com/wwl/export/crypto/tool/stqrg.html\n'
'\n'
'If you require further assistance please contact us by '
'sending email to\n'
'export@cisco.com.\n'
'\n'
'License Level: ax\n'
'License Type: N/A(Smart License Enabled)\n'
'Next reload license Level: ax\n'
'\n'
'\n'
'Smart Licensing Status: UNREGISTERED/No Licenses in Use\n'
'\n'
'cisco CSR1000V (VXE) processor (revision VXE) with '
'2078006K/3075K bytes of memory.\n'
'Processor board ID 9SAGBHTUEE9\n'
'9 Gigabit Ethernet interfaces\n'
'32768K bytes of non-volatile configuration memory.\n'
'3978460K bytes of physical memory.\n'
'6188032K bytes of virtual hard disk at bootflash:.\n'
'\n'
'Configuration register is 0x2102'}
^^^^ END napalm_cli ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>>>
Step 3¶
Create a new variable, show_interface_brief, to send a different command. This time send the "show ip interface brief" command.
Step 4¶
In this step, rather than using the print_result function, use a for loop to access the "AggregatedResult" and print out the host for every result output.
>>> for host, interface_brief in show_interface_brief.items():
... print(f"\nHost: {host}\n {interface_brief.result['show ip interface brief']}")
...
Host: csr1
Interface IP-Address OK? Method Status Protocol
GigabitEthernet1 10.0.0.15 YES NVRAM up up
GigabitEthernet2 unassigned YES NVRAM up up
GigabitEthernet3 unassigned YES NVRAM up up
GigabitEthernet4 unassigned YES NVRAM up up
GigabitEthernet5 unassigned YES NVRAM up up
GigabitEthernet6 unassigned YES NVRAM administratively down down
GigabitEthernet7 unassigned YES NVRAM administratively down down
GigabitEthernet8 unassigned YES NVRAM administratively down down
GigabitEthernet9 unassigned YES NVRAM administratively down down
Host: csr2
Interface IP-Address OK? Method Status Protocol
GigabitEthernet1 10.0.0.15 YES NVRAM up up
GigabitEthernet2 unassigned YES NVRAM up up
GigabitEthernet3 unassigned YES NVRAM up up
GigabitEthernet4 unassigned YES NVRAM up up
GigabitEthernet5 unassigned YES NVRAM up up
GigabitEthernet6 unassigned YES NVRAM administratively down down
GigabitEthernet7 unassigned YES NVRAM administratively down down
GigabitEthernet8 unassigned YES NVRAM administratively down down
GigabitEthernet9 unassigned YES NVRAM administratively down down
Host: csr3
Interface IP-Address OK? Method Status Protocol
GigabitEthernet1 10.0.0.15 YES NVRAM up up
GigabitEthernet2 unassigned YES NVRAM up up
GigabitEthernet3 unassigned YES NVRAM up up
GigabitEthernet4 unassigned YES NVRAM up up
GigabitEthernet5 unassigned YES NVRAM up up
GigabitEthernet6 unassigned YES NVRAM administratively down down
GigabitEthernet7 unassigned YES NVRAM administratively down down
GigabitEthernet8 unassigned YES NVRAM administratively down down
GigabitEthernet9 unassigned YES NVRAM administratively down down
>>>
Step 5¶
Create a variable to filter out csr1. In this step, use the napalm_cli module again, except this time you will be sending a list of commands. Inside the commands argument, add the "show ip interface brief" and "show version" commands.
>>>
>>> csr1 = nr.filter(name="csr1")
>>>
>>> list_commands = csr1.run(napalm_cli, commands=["show ip interface brief", "show version"])
>>>
Step 6¶
Create two different variables, one called interface_brief and the other version. In the value of each variable, assign the result of each command.
>>>
>>> interface_brief = list_commands['csr1'].result['show ip interface brief']
>>>
>>> version = list_commands['csr1'].result['show version']
>>>
Step 7¶
Use the print function to the result stored in interface_brief.
>>>
>>>
>>> print(interface_brief)
Interface IP-Address OK? Method Status Protocol
GigabitEthernet1 10.0.0.15 YES NVRAM up up
GigabitEthernet2 unassigned YES NVRAM up up
GigabitEthernet3 unassigned YES NVRAM up up
GigabitEthernet4 unassigned YES NVRAM up up
GigabitEthernet5 unassigned YES NVRAM up up
GigabitEthernet6 unassigned YES NVRAM administratively down down
GigabitEthernet7 unassigned YES NVRAM administratively down down
GigabitEthernet8 unassigned YES NVRAM administratively down down
GigabitEthernet9 unassigned YES NVRAM administratively down down
>>>
Step 8¶
Print the version variable.
>>>
>>>
>>> print(version)
Cisco IOS XE Software, Version 17.01.01
Cisco IOS Software [Amsterdam], Virtual XE Software (X86_64_LINUX_IOSD-UNIVERSALK9-M), Version 17.1.1, RELEASE SOFTWARE (fc3)
Technical Support: http://www.cisco.com/techsupport
Copyright (c) 1986-2019 by Cisco Systems, Inc.
Compiled Fri 22-Nov-19 03:39 by mcpre
Cisco IOS-XE software, Copyright (c) 2005-2019 by cisco Systems, Inc.
All rights reserved. Certain components of Cisco IOS-XE software are
licensed under the GNU General Public License ("GPL") Version 2.0. The
software code licensed under GPL Version 2.0 is free software that comes
with ABSOLUTELY NO WARRANTY. You can redistribute and/or modify such
GPL code under the terms of GPL Version 2.0. For more details, see the
documentation or "License Notice" file accompanying the IOS-XE software,
or the applicable URL provided on the flyer accompanying the IOS-XE
software.
ROM: IOS-XE ROMMON
csr1 uptime is 6 days, 4 hours, 1 minute
Uptime for this control processor is 6 days, 4 hours, 2 minutes
System returned to ROM by reload
System image file is "bootflash:packages.conf"
Last reload reason: reload
This product contains cryptographic features and is subject to United
States and local country laws governing import, export, transfer and
use. Delivery of Cisco cryptographic products does not imply
third-party authority to import, export, distribute or use encryption.
Importers, exporters, distributors and users are responsible for
compliance with U.S. and local country laws. By using this product you
agree to comply with applicable laws and regulations. If you are unable
to comply with U.S. and local laws, return this product immediately.
A summary of U.S. laws governing Cisco cryptographic products may be found at:
http://www.cisco.com/wwl/export/crypto/tool/stqrg.html
If you require further assistance please contact us by sending email to
export@cisco.com.
License Level: ax
License Type: N/A(Smart License Enabled)
Next reload license Level: ax
Smart Licensing Status: UNREGISTERED/No Licenses in Use
cisco CSR1000V (VXE) processor (revision VXE) with 2078006K/3075K bytes of memory.
Processor board ID 9SAGBHTUEE9
9 Gigabit Ethernet interfaces
32768K bytes of non-volatile configuration memory.
3978444K bytes of physical memory.
6188032K bytes of virtual hard disk at bootflash:.
Configuration register is 0x2102
>>>
Step 9¶
Use the print_result function to view the results of list_commands.
>>>
>>> print_result(list_commands)
napalm_cli**********************************************************************
* csr1 ** changed : False ******************************************************
vvvv napalm_cli ** changed : False vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv INFO
{ 'show ip interface brief': 'Interface IP-Address OK? '
'Method Status Protocol\n'
'GigabitEthernet1 10.0.0.15 YES '
'NVRAM up up \n'
'GigabitEthernet2 unassigned YES '
'NVRAM up up \n'
'GigabitEthernet3 unassigned YES '
'NVRAM up up \n'
'GigabitEthernet4 unassigned YES '
'NVRAM up up \n'
'GigabitEthernet5 unassigned YES '
'NVRAM up up \n'
'GigabitEthernet6 unassigned YES '
'NVRAM administratively down down \n'
'GigabitEthernet7 unassigned YES '
'NVRAM administratively down down \n'
'GigabitEthernet8 unassigned YES '
'NVRAM administratively down down \n'
'GigabitEthernet9 unassigned YES '
'NVRAM administratively down down',
'show version': 'Cisco IOS XE Software, Version 17.01.01\n'
'Cisco IOS Software [Amsterdam], Virtual XE Software '
'(X86_64_LINUX_IOSD-UNIVERSALK9-M), Version 17.1.1, RELEASE '
'SOFTWARE (fc3)\n'
'Technical Support: http://www.cisco.com/techsupport\n'
'Copyright (c) 1986-2019 by Cisco Systems, Inc.\n'
'Compiled Fri 22-Nov-19 03:39 by mcpre\n'
'\n'
'\n'
'Cisco IOS-XE software, Copyright (c) 2005-2019 by cisco '
'Systems, Inc.\n'
'All rights reserved. Certain components of Cisco IOS-XE '
'software are\n'
'licensed under the GNU General Public License ("GPL") '
'Version 2.0. The\n'
'software code licensed under GPL Version 2.0 is free '
'software that comes\n'
'with ABSOLUTELY NO WARRANTY. You can redistribute and/or '
'modify such\n'
'GPL code under the terms of GPL Version 2.0. For more '
'details, see the\n'
'documentation or "License Notice" file accompanying the '
'IOS-XE software,\n'
'or the applicable URL provided on the flyer accompanying '
'the IOS-XE\n'
'software.\n'
'\n'
'\n'
'ROM: IOS-XE ROMMON\n'
'\n'
'csr1 uptime is 6 days, 4 hours, 1 minute\n'
'Uptime for this control processor is 6 days, 4 hours, 2 '
'minutes\n'
'System returned to ROM by reload\n'
'System image file is "bootflash:packages.conf"\n'
'Last reload reason: reload\n'
'\n'
'\n'
'\n'
'This product contains cryptographic features and is subject '
'to United\n'
'States and local country laws governing import, export, '
'transfer and\n'
'use. Delivery of Cisco cryptographic products does not '
'imply\n'
'third-party authority to import, export, distribute or use '
'encryption.\n'
'Importers, exporters, distributors and users are '
'responsible for\n'
'compliance with U.S. and local country laws. By using this '
'product you\n'
'agree to comply with applicable laws and regulations. If '
'you are unable\n'
'to comply with U.S. and local laws, return this product '
'immediately.\n'
'\n'
'A summary of U.S. laws governing Cisco cryptographic '
'products may be found at:\n'
'http://www.cisco.com/wwl/export/crypto/tool/stqrg.html\n'
'\n'
'If you require further assistance please contact us by '
'sending email to\n'
'export@cisco.com.\n'
'\n'
'License Level: ax\n'
'License Type: N/A(Smart License Enabled)\n'
'Next reload license Level: ax\n'
'\n'
'\n'
'Smart Licensing Status: UNREGISTERED/No Licenses in Use\n'
'\n'
'cisco CSR1000V (VXE) processor (revision VXE) with '
'2078006K/3075K bytes of memory.\n'
'Processor board ID 9SAGBHTUEE9\n'
'9 Gigabit Ethernet interfaces\n'
'32768K bytes of non-volatile configuration memory.\n'
'3978444K bytes of physical memory.\n'
'6188032K bytes of virtual hard disk at bootflash:.\n'
'\n'
'Configuration register is 0x2102'}
^^^^ END napalm_cli ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>>>
Task 3 - Send Operational Commands using Netmiko¶
Another useful network module to gather data from a device is netmiko_send_command. Similar to the napalm_cli module, it uses the CLI to send operational commands and return the string output of the result.
Step 1¶
In the /home/ntc/nornir folder, create a file named nr_netmiko.py.
Add the following code to it, importing the netmiko_send_command module to start using it. Also, initialize Nornir again, except this time, use the netmiko_configuration.yml file to provide the correct driver for the Netmiko module.
from nornir import InitNornir
from nornir_netmiko.tasks import netmiko_send_command
from nornir_utils.plugins.functions import print_result, print_title
from nornir.core.filter import F
from rich import print
nr = InitNornir(config_file="nornir_configuration/netmiko_configuration.yml")
Step 2¶
First, execute the nr_netmiko.py file in a new interactive Python shell (notice the -i parameter). Then, use the filter function to only target the csr2 device.
Step 3¶
Create a variable named show_version and use the csr2 object to run the netmiko_send_command task. Use the command_string argument and provide the show version string.
Step 4¶
Use the print_result function to print out the result of show_version. Notice the output of the result is different from the napalm_cli module. This time the output is just the command output and not inside a JSON key with the command sent to the device.
>>>
>>> print_result(show_version)
netmiko_send_command************************************************************
* csr2 ** changed : False ******************************************************
vvvv netmiko_send_command ** changed : False vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv INFO
Cisco IOS XE Software, Version 17.01.01
Cisco IOS Software [Amsterdam], Virtual XE Software (X86_64_LINUX_IOSD-UNIVERSALK9-M), Version 17.1.1, RELEASE SOFTWARE (fc3)
Technical Support: http://www.cisco.com/techsupport
Copyright (c) 1986-2019 by Cisco Systems, Inc.
Compiled Fri 22-Nov-19 03:39 by mcpre
Cisco IOS-XE software, Copyright (c) 2005-2019 by cisco Systems, Inc.
All rights reserved. Certain components of Cisco IOS-XE software are
licensed under the GNU General Public License ("GPL") Version 2.0. The
software code licensed under GPL Version 2.0 is free software that comes
with ABSOLUTELY NO WARRANTY. You can redistribute and/or modify such
GPL code under the terms of GPL Version 2.0. For more details, see the
documentation or "License Notice" file accompanying the IOS-XE software,
or the applicable URL provided on the flyer accompanying the IOS-XE
software.
ROM: IOS-XE ROMMON
csr2 uptime is 1 week, 4 days, 8 hours, 47 minutes
Uptime for this control processor is 1 week, 4 days, 8 hours, 49 minutes
System returned to ROM by reload
System image file is "bootflash:packages.conf"
Last reload reason: reload
This product contains cryptographic features and is subject to United
States and local country laws governing import, export, transfer and
use. Delivery of Cisco cryptographic products does not imply
third-party authority to import, export, distribute or use encryption.
Importers, exporters, distributors and users are responsible for
compliance with U.S. and local country laws. By using this product you
agree to comply with applicable laws and regulations. If you are unable
to comply with U.S. and local laws, return this product immediately.
A summary of U.S. laws governing Cisco cryptographic products may be found at:
http://www.cisco.com/wwl/export/crypto/tool/stqrg.html
If you require further assistance please contact us by sending email to
export@cisco.com.
License Level: ax
License Type: N/A(Smart License Enabled)
Next reload license Level: ax
Smart Licensing Status: UNREGISTERED/No Licenses in Use
cisco CSR1000V (VXE) processor (revision VXE) with 2078006K/3075K bytes of memory.
Processor board ID 9SAGBHTUEE9
9 Gigabit Ethernet interfaces
32768K bytes of non-volatile configuration memory.
3978444K bytes of physical memory.
6188032K bytes of virtual hard disk at bootflash:.
Configuration register is 0x2102
^^^^ END netmiko_send_command ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>>>
Step 5¶
Create a variable with a list of commands.
Step 6¶
To be able to send a list of commands using the netmiko_send_command module, a for loop needs to be used to iterate through the list of commands since the command_string argument only takes in a string as input and not a list as the napalm_cli module would.
Inside the for loop, build the task that is going to send the commands to the device. In the command_string argument, use the commands variable that will hold each command in the list. Finally, use the print_result function to view the result of show_command task.
>>>
>>>
>>> for commands in list_commands:
... show_command = csr2.run(
... task=netmiko_send_command,
... command_string=commands)
... print_result(show_command)
...
netmiko_send_command************************************************************
* csr2 ** changed : False ******************************************************
vvvv netmiko_send_command ** changed : False vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv INFO
Cisco IOS XE Software, Version 17.01.01
Cisco IOS Software [Amsterdam], Virtual XE Software (X86_64_LINUX_IOSD-UNIVERSALK9-M), Version 17.1.1, RELEASE SOFTWARE (fc3)
Technical Support: http://www.cisco.com/techsupport
Copyright (c) 1986-2019 by Cisco Systems, Inc.
Compiled Fri 22-Nov-19 03:39 by mcpre
Cisco IOS-XE software, Copyright (c) 2005-2019 by cisco Systems, Inc.
All rights reserved. Certain components of Cisco IOS-XE software are
licensed under the GNU General Public License ("GPL") Version 2.0. The
software code licensed under GPL Version 2.0 is free software that comes
with ABSOLUTELY NO WARRANTY. You can redistribute and/or modify such
GPL code under the terms of GPL Version 2.0. For more details, see the
documentation or "License Notice" file accompanying the IOS-XE software,
or the applicable URL provided on the flyer accompanying the IOS-XE
software.
ROM: IOS-XE ROMMON
csr2 uptime is 1 week, 4 days, 8 hours, 51 minutes
Uptime for this control processor is 1 week, 4 days, 8 hours, 52 minutes
System returned to ROM by reload
System image file is "bootflash:packages.conf"
Last reload reason: reload
This product contains cryptographic features and is subject to United
States and local country laws governing import, export, transfer and
use. Delivery of Cisco cryptographic products does not imply
third-party authority to import, export, distribute or use encryption.
Importers, exporters, distributors and users are responsible for
compliance with U.S. and local country laws. By using this product you
agree to comply with applicable laws and regulations. If you are unable
to comply with U.S. and local laws, return this product immediately.
A summary of U.S. laws governing Cisco cryptographic products may be found at:
http://www.cisco.com/wwl/export/crypto/tool/stqrg.html
If you require further assistance please contact us by sending email to
export@cisco.com.
License Level: ax
License Type: N/A(Smart License Enabled)
Next reload license Level: ax
Smart Licensing Status: UNREGISTERED/No Licenses in Use
cisco CSR1000V (VXE) processor (revision VXE) with 2078006K/3075K bytes of memory.
Processor board ID 9SAGBHTUEE9
9 Gigabit Ethernet interfaces
32768K bytes of non-volatile configuration memory.
3978444K bytes of physical memory.
6188032K bytes of virtual hard disk at bootflash:.
Configuration register is 0x2102
^^^^ END netmiko_send_command ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
netmiko_send_command************************************************************
* csr2 ** changed : False ******************************************************
vvvv netmiko_send_command ** changed : False vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv INFO
Interface IP-Address OK? Method Status Protocol
GigabitEthernet1 10.0.0.15 YES NVRAM up up
GigabitEthernet2 unassigned YES NVRAM up up
GigabitEthernet3 unassigned YES NVRAM up up
GigabitEthernet4 unassigned YES NVRAM up up
GigabitEthernet5 unassigned YES NVRAM up up
GigabitEthernet6 unassigned YES NVRAM administratively down down
GigabitEthernet7 unassigned YES NVRAM administratively down down
GigabitEthernet8 unassigned YES NVRAM administratively down down
GigabitEthernet9 unassigned YES NVRAM administratively down down
^^^^ END netmiko_send_command ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>>>