TelnetCisco.py – A Reusable Module for Accessing Cisco Devices with Python

For one reason or another, Python seems to have been my go to scripting language of choice recently. One of the things that I’ve been working on is creating a reusable python library for accessing Cisco devices via telnet. It’s pretty basic code right now, but I’ll be expanding upon what I have soon and will be sharing via github.com as well. For now, here is my simple library.

Usage is pretty simple. You need to specify a username, password, enable password, and host variable. To activate the module. The easiest way is to do it within the your python script.

Of course, the module also has options to specify a authentication file (credsFile(authfile)) or prompt prompt for your credentials (getCreds()). At the moment, the script only runs a ‘show arp’ on your devices. I’m still working on how I want to implement feeding commands to your devices. I’ll post an update as I get more functionality working.

February 17, 2014

Posted In: Cisco Administration Python Scripting, Python Tips