Automation options for network devices
There are various networking vendors out there (example Cisco, Juniper, F5, ...). Every vendor provides command line access to its device. The networking shell is usually something unique for a vendor and requires some time to master it. The most popular way to access the shell is to use SSH protocol although.
It is sad that many networking vendors doesn't supply any form of API for device configuration and management (only very few, example F5 iControl). Usually there is only command line shell or GUI.
From operational point of view it is a tedious job to try to automate your routine tasks. In practice, at the end you are going to be forced to write your own scripts and programs. Below is a list of frameworks and libraries I've found to help me to get my job done.
As a site note, the good thing is that it is changing. Probably the most significant force behind the new technologies is SDN, Openflow and cloud.
What Perl libraries can I use to write my scripts to manage Cisco devices
http://search.cpan.org/~oliver/Net-Appliance-Session-4.131260/lib/Net/Appliance/Session.pm
http://search.cpan.org/~oliver/Net-CLI-Interact-2.131260/lib/Net/CLI/Interact.pm
http://search.cpan.org/~mingzhang/Angel_101/
What Python libraries can I use to manage Cisco devices
http://pydoc.net/Python/ciscolib/0.1/
More like a source code browser.
http://code.ohloh.net/search?s=cisco&browser=Default&pp=0&fl=Python&mp=1&ml=0&me=1&md=1&ff=1&filterChecked=true
You can always mange your SSH session manually using Python SSH libraries
http://stackoverflow.com/questions/5238000/persistent-ssh-session-to-cisco-router
http://linuxdynasty.org/219/howto-manage-your-networked-devices-using-python-and-pexpect/
What Ruby libraries can I use to manage Cisco devices
https://github.com/net-ssh?tab=repositories
Summary
From my investigation it looks that Perl has the most mature option when it comes to network devices automation libraries.
There is only few Python code available that natively supports network appliance management over SSH command line. Situation looks identical with Ruby. To write a bigger thing you would have need to manually write all code including SSH session(s) management, command execution, output delivery and redirections as well as error handling.
Search This Blog
Showing posts with label library. Show all posts
Showing posts with label library. Show all posts
Thursday, June 20, 2013
Saturday, August 11, 2012
How to execute remote commands from python over ssh connection
There are a number of possible solution for Python that allow you to execute a command remotely. Below is a list of libraries/modules I found when researching it.
This is a simple python example as well.
- paramiko http://www.lag.net/paramiko/
- ssh module ( a wrapper for paramiko) http://stackoverflow.com/questions/1939107/python-libraries-for-ssh-handling
- pythion binding to C libssh library http://www.no-ack.org/2010/11/python-bindings-for-libssh2.html
- fabric http://docs.fabfile.org/en/1.4.3/index.html>
- python SSH module (base on the paramiko) http://pypi.python.org/pypi/ssh/1.7.11
http://pypi.python.org/pypi/paramiko/1.7.7.2
http://media.commandline.org.uk/code/ssh.txt
https://github.com/bitprophet/ssh
This is a simple python example as well.
Subscribe to:
Posts (Atom)