Using netmiko library to configure network equipments

When you want to retrieve information from network equipments, you can use :

  • Web interface (usually disabled for security purpose, and slow)
  • CLI (fast but can take a long time if you have many switches)
  • Management platform like IMC, Airwave or Prime infrastructure (not very convenient, require often a lot of time to configure, slow)

So I looked for another solution more modular. I am using scripts in python with Netmiko library. I am using a centos VM with following packages installed:

  • python3
  • pip3

You can install netmiko using pip like this :

pip install netmiko

I was working with Aruba OS. For those who know, the HP CLI is very slow when started, you have a long stop time after the CLI is ready :

So you have to change a timer when you call the connectHandler method, if not, you have a random output error when you try to run the script :

device = ConnectHandler(global_delay_factor=2,device_type=platform, ip=IP, username=username, password=password, blocking_timeout=16)

I am not a master in python and I always search on google to find how to developp properly, but I was able to create some usefull script to retrieve data. I will share some of them in another post.

Author: Kévin SAS

I am Kévin SAS and live in France. I am an engineer in network and security. I worked for a lot of customers in these domains : Wireless, LAN, Datacenter, VoIP with several brands like Cisco, HPE, Aruba, Palo Alto amongst others. Previously working for a service provider. I currently work for an integrator while giving me lots of opportunity to learn. This blog stores some technicals notes I wanted to share.

Leave a Reply

Your email address will not be published. Required fields are marked *