[python]show run object network

Cisco ASA's show run object network will show the subnet, host and range objects, netmiko has a textfsm template to match the result in dictionary, however there is no template to match show run object service hence for the service part you will need to write your own textfsm template. On this example I will … Continue reading [python]show run object network

Advertisement

[python]Convert TextFSM nested list data into dictionary

Introduction Reference: http://gratuitousarp.info/a-quick-example-of-using-textfsm-to-parse-data-from-cisco-show-commands/ The reference article alluded a method known as value_map, I immediately knew it is possible to change to dictionary easily when I saw the output of value_map. This is how the output of value_map looks like, and this explains how the variable maps to the regex, if you are using re module … Continue reading [python]Convert TextFSM nested list data into dictionary

[python]Use TextFSM to easily get objects you need from unstructured data.

Introduction Netmiko has support of textfsm, however it does not have every template to help the matching, to learn how to use textfsm is useful in this situation which you can create your own template without overly rely on module's limited template. TextFSM is created by google, it provides easier and more structured way of … Continue reading [python]Use TextFSM to easily get objects you need from unstructured data.

[python]How to capture results with nornir

Introduction Nornir is a framework for network automation, it gels popular automation tools such as napalm, netmiko, paramiko and Ansible. However I could not find good examples on how to parse the result if I use show access-list with netmiko_send_command during task.run. There is a built in print_result() function which shows the status and output … Continue reading [python]How to capture results with nornir

[python]Filter inventory – Nornir

Introduction Nornir is a framework for network automation, it gels netmiko, paramiko, ansible, yaml, ansible, napalm, netconf together, this is a must have package for doing network automation and it is not too difficult to learn. There will be time when specific configuration is for specific device in the inventory, in order to push to … Continue reading [python]Filter inventory – Nornir