Creating Templates for TextFSM and ntc_show_command
Less than two weeks ago I wrote a post about an Ansible module called ntc_show_command. For those that didn’t read that post, you should, but ntc_show_command is a multi-vendor module that can automate converting raw text from show commands into structured data, namely JSON.
We’ve already had several pull requests enhancing the architecture, so the community support is off to a great start! But in order to really make an impact, we (me, you, and fellow network engineers) need to continue to contribute templates to the project repository. Templates are key to converting the raw text into JSON.
This post will walk through how to create a template for two different commands. We’ll take a look at show version for Cisco NX-OS and display version for HP Comware 7.
The first thing that we’ll need to do is get the raw text output that we want to JSONify. We’ll start with show version.
Below is the sample output that we’ll work with and this file will be saved as tests/cisco_nxos/cisco_nxos_show_version.raw within our project directory.
Cisco Nexus Operating System (NX-OS) Software
TAC support: http://www.cisco.com/tac
Copyright (C) 2002-2014, Cisco and/or its affiliates.
All rights reserved.
The copyrights to certain Continue reading
Cloud-based storage needs a disconnect, the startup believes.
ECI's LightApps is helping Sweden's transportation agency use its network more efficiently.
What can SkySecure do for you? Get your more important workloads into the cloud without worry.
Join the September 25th Cisco DemoFriday and learn how you can benefit from network programmability as you transition from legacy systems to open standard interfaces.
A looming deadline and the recent stock panic are fueling talks of VMware acquiring EMC.