Netmiko TextFSM

I have used TextFSM in my Netmiko TACACS script in order to parse the show version and show inventory outputs to determine the type of Cisco OS the device is.

The templates maybe found https://github.com/networktocode/ntc-templates/tree/master/ntc_templates/templates
They were already installed when I installed Netmiko

Using TextFSM is very simple. Netmiko takes in one extra parameter to use TextFSM which is True or False. An example from my Revision2 TACACS script.

Examples of the dictionaries that are returned when parsed. This is an NXOS virtual switch running in my GNS3 lab.

Leave a Comment

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