Some random python scripts that I’ve created during my learning trail. These scripts focuses primarily on use-cases for Network Engineers. All examples are available on the python script examples GitHub repository.


Custom filters for a Jinja2 based Config Generator

Custom filters for a Jinja2 based Config Generator

This week, I’ll show you how to integrate custom filters into your Jinja2 templates. The use case from this post is based on the idea of a feature-centric and vendor independent parameter set for the configuration of network devices. We will see how custom filters could be helpful to generate configurations for multiple vendors based on a common parameter set.
Cisco NX-API on Nexus 5500

Cisco NX-API on Nexus 5500

This week I will dive more into a network programmability topic. I will show you a practical use case for the Cisco NX-API. It provides an interface to communicate with a Nexus device using HTTP/HTTPs using JSON or XML. Because of the reliable request-response nature of the HTTP protocol, it is usually more preferable than scraping Telnet/SSH outputs.
Use Vagrant to run the Python examples

Use Vagrant to run the Python examples

I will show you this week how to use Vagrant to run the python scripts from my examples repository without any changes on your working environment. The only thing that you need are two tools: VirtualBox and Vagrant. I think that VirtualBox is quite common today to host VMs on your laptop. Vagrant is primarily a tool to create and provision these machines based on a single configuration file. It is very useful if you need to share it e.g. for development purpose.
Parse CLI outputs with TextFSM

Parse CLI outputs with TextFSM

Some weeks ago, I got the request to check parts from more than 5000 lines show inventory output for there end of live state. How to handle this at scale? My solution: parse the data using TextFSM.