Tip: If you're looking for a faster alternative to Netmiko for CLI scraping, consider using Scrapli. It offers various transport types, such as SSH2, which can significantly enhance speed.
Here's a short example 👇
# Install: pip install scrapli
from scrapli import Scrapli
device = {
"host": "172.29.151.1",
"auth_username": "user",
"auth_password": "password",
"auth_strict_key": False,
"platform": "cisco_nxos",
"transport": "ssh2",
}
with Scrapli(**device) as conn:
response = conn.send_command("show version")
print(response.result)
# Output:
# Cisco Nexus Operating System (NX-OS) Software
# ...
# Software
# BIOS: version
# NXOS: version 9.3(7a)
# ...