Skip to main content

Posts

Showing posts from August, 2017

Python Crumbs for Cisco routers - Part I

In this series I want to show you how to use Python to solve some common tasks related to Cisco router scripting. Update, 2018.06 : I compiled a short training video that will teach you the basic Python scripting in PGT. If you prefer watching a video over reading the article, this is exactly for you :  PrettyGoodTerminal - Using Python Scripts This tutorial will focus only on - so to say - applied Python language and won't go into details with Python syntax or language elements itself for one very good reason : at the beginning you probably want to have results quickly without reading hundreds of pages about the language. I always affirmed that learning something new is much easier when you get  a grasp on it on a practical way. The most common task I came across is getting some basic information of  a router or switch, like system uptime, version, interface status, etc. Of course, you don't need Python for simple queries, but when you need to do some text process

Python Crumbs for Cisco routers - Part II

In my  previous post I discussed the basics of using Python scripts with Pretty Good Terminal. What I want to share now is a specific script I created to investigate an issue.  One of our customer's network exhibited connection issues over DLS lines. There were around 20,000 Cisco 800 series routers connected to the network, and around 200 of these experienced intermittent reachability issues once in a while.  To check whether the issue was related to the DSL line or not, I had the idea to use specific IOS commands to collect DSL contoller data from the routers. There were two types of routers involved : Cisco 857 and 867VAE. On a 857 router one can use the "sh dsl interface atm 0" command, while on a 867VAE the "sh controllers vdsl 0" command needs to be issued. So the first thing a script should do is to detect the router type and based on it issue the correct command. This is something I covered in my previous post, so I will simple reuse the code pos