[python]Dissecting AggregatedResult

I felt it is worth to take some of my sleeping time to document how to dissect AggregatedResult object after a nornir task is executed. napalm_get with getters=["config"] This are my user inputs: example: After nornir task is executed an AggregatedResult object which looks like below: AggregatedResult is a dictionary like object, in this example … Continue reading [python]Dissecting AggregatedResult

[python]Cisco FMC REST API example – GET Server version and add device to Cisco FMC

Introduction The version used for this lab is Cisco FMC 6.4.0, and Cisco FTD used is 6.3.0. To access the Cisco FMC REST API, you need to ensure it is enabled. You can test it by going to https:///api/api-explorer if you can see the swagger like documentation then the REST API is enabled, you can … Continue reading [python]Cisco FMC REST API example – GET Server version and add device to Cisco FMC

[python]Download videos from youtube with pytube

Introduction I am finding a windows application which can use to download youtube videos like downie, I found out a python module known as pytube3 that can be used for this purpose. Basic usage So for my own purpose I download some videos which I need to listen while exercising, below is the code to … Continue reading [python]Download videos from youtube with pytube

[python]Checking whether the hosts in inventory are alive with Nornir

Nornir has a tcp_ping function that can be used to test connections within the inventory file. You can check one or multiple ports, you can also specify the hosts of your choice So let's see how can this be used. Check if a port is live for hosts in inventory This is my yaml inventory … Continue reading [python]Checking whether the hosts in inventory are alive with Nornir

[python]Understanding how to capture the result you need with Nornir

Introduction The documentation has illustrated how to display the output to the console screen, however it did not explicitly show how to capture the data you need. It does document about what is AggregatedResult object and Result object, but still using examples will be easier to understand and also to encourage more people to use … Continue reading [python]Understanding how to capture the result you need with Nornir

[python]Nornir framework usage example 1 – show ip int brief

Introduction Before using Nornir, I was using netmiko, netmiko is a steady module which makes configuring, getting information from cisco based devices easily. Of course netmiko is not limited to just Cisco, it is a multi-vendor module. Napalm is another network module which does the same thing as netmiko, however when dealing with Cisco ios … Continue reading [python]Nornir framework usage example 1 – show ip int brief

[python]TextFSM to match show interface summary

The Cisco ASAv has a command show interface summary, this command output has a lot of information, these are the interesting information I need from this command: Interface id including the sub interface if available nameif, which is the name interface which must be configured administrative status protocol status vlan id if available ip address … Continue reading [python]TextFSM to match show interface summary

[python]Comparing execution time without threading, with threadpoolexecutor and threading subclass

3 round results to print out the execution time of calling the functions This is a comparison in execution time by sending show version to three Cisco ASA - fw01, fw02 and fw03. All connections with netmiko.ConnectHandler has a global_delay_factor of 0.5s. I have made three functions: connect_device_type_1: This function does not use threading but … Continue reading [python]Comparing execution time without threading, with threadpoolexecutor and threading subclass