Parse Coriant/Tellabs CLI Inventory outputs to csv

In my current project i need to generate inventory output for Coriant/Tellabs. We have hundred device that need to be reported. And the only way that we can do is capturing show hw-inventory in each devices and do manual parsing from these logs.

It still hard although for 1 – 2 devices, usually for this kind of jobs i can do it using notepad++ with several formula. But because this device is different one, from hw-inventory is not structured and i cant do it from notepad++ because of that. I need to map each line to another line and paste it to excel ONE BY ONE. And i have hundred device that need to be reported

Lucky i found blog article that i can do to automate all of these logs into single csv files without much effort. But still i need to do some modify. I already compile my script to my github.

To run those script, we need to use python3 and install library textfsm

Output as csv files and the output still not human readable naturally. But you can do simple filter delimited by semicolon and violla you can get result as expected.

TBH im still learn python, maybe you will find some anomaly or bugs during runn those script. I create 2 files for source textfsm : tellabs-sfp and tellabs-module.

  • tellabs-sfp : generate output based on sfp
  • tellabs-module : generate output based on module

My source of reference for this project :

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.