This lesson is part of the Network Configuration with Netmiko Course.
In this lesson, we will cover:
- Review of single-threaded Netmiko execution.
- How to write a multiple threaded Netmiko script.
- Time testing and comparing single-threaded vs multi-threaded Netmiko execution.
The scripts and code for this lesson can be found within the Netmiko repo under the directory:
So far through this guide, we have run Netmiko against a single device. However, what about if we want to start running Netmiko across multiple devices? This section will look at how we can use multithreading to scale Netmiko to run across multiple devices.
Let's create a script to run a command against multiple devices. To do so, we use many of the commands and Netmiko methods that we have previously learnt, along with:
- defining a
- adding a timer to time how long the script takes using the
- iterating over our device
list(), performing the
send_commandon each iteration, collects the output of