Networking-Forums.com

Professional Discussions => Programming Goodies and Software-Defined Networking => Topic started by: dlots on February 14, 2017, 06:23:02 PM

Title: Uploaded some stuff to github
Post by: dlots on February 14, 2017, 06:23:02 PM
https://github.com/GoreNetwork/
I put 2 new programs on here, both are still kinda beta.

1 takes a traceroute (or list of IPs), SSHs to all the devices, pulls the CPU info, and interfaces.  It then makes an HTTP page that shows all your interfaces (that are decently in use), Mb/s In and out, and error rates in/out.

The other I am working on to update IOSs, currently some stuff is hard-coded that shouldn't be like directory names ('flash' vs 'bootflash') etc
Title: Re: Uploaded some stuff to github
Post by: wintermute000 on February 14, 2017, 07:56:09 PM
great work on the first one! will steal :)

look @ textfsm for next time, would abstract a lot of your manual kirk byers course style line stripping functions etc
Title: Re: Uploaded some stuff to github
Post by: EOS on February 15, 2017, 06:01:55 AM
Nice work!

Thank you for sharing
Title: Re: Uploaded some stuff to github
Post by: dlots on February 15, 2017, 10:49:56 AM
Thank you
I will look into textfsm!
I really hate all the split work I had to do!
Title: Re: Uploaded some stuff to github
Post by: that1guy15 on February 15, 2017, 12:20:30 PM
Nice dude!

I agree TextFSM is a good option. Just starting to dig through it myself.
Title: Re: Uploaded some stuff to github
Post by: wintermute000 on February 15, 2017, 05:09:58 PM
that1guy, you cna extend textfsm automagicallyt via ansible with ntc-ansible :)


and check out ntc-check in my github
Title: Re: Uploaded some stuff to github
Post by: that1guy15 on February 16, 2017, 08:32:04 AM
Quote from: wintermute000 on February 15, 2017, 05:09:58 PM
that1guy, you cna extend textfsm automagicallyt via ansible with ntc-ansible :)


and check out ntc-check in my github

Yeah that is where Im running into it and starting to dig. The ntc-ansible show_command module is limited to specific commands and is missing output that I need. So I gotta add to it.

Yes good idea I need to review your stuff again to see if it fits in here. Thanks!
Title: Re: Uploaded some stuff to github
Post by: wintermute000 on February 16, 2017, 03:30:17 PM
Do your own textfsm template and submit a pull request to the ntc-templates repo
https://github.com/networktocode/ntc-templates (https://github.com/networktocode/ntc-templates)


I'd leave it to edelmen and co thou to modify the python for ntc-ansible to parse for the correct command / invoke the correct textfsm template


It ain't hard to call textfsm natively





        # CONVERT TO STRING AND REMOVE LINE BREAKS
        output = ('\n'.join(map(str.rstrip, show_output)))
        template = open("get-bgp-routes.template")
        re_table = textfsm.TextFSM(template)
        fsm_results = re_table.ParseText(output)