Exscript

A scripting language for automating network connections over protocols such as Telnet or SSH.
Download

Exscript Ranking & Summary

Advertisement

  • Rating:
  • License:
  • GPL
  • Price:
  • FREE
  • Publisher Name:
  • Samuel Abels
  • Publisher web site:
  • http://code.google.com/p/exscript/

Exscript Tags


Exscript Description

A scripting language for automating network connections over protocols such as Telnet or SSH. Exscript is a scripting language for automating network connections over protocols such as Telnet or SSH. Exscript is in some ways comparable to Expect, but has some unique features that make it a lot easier to use and understand for non-developers.Exscript is written in Python and we value componentized, clean code, so it will always be easy to modify and extend.Quick IntroductionWith Exscript you can quickly automate a conversation with a device over Telnet or SSH. For example, to execute the "ls" command on three different hosts, create a file with the following content: lsand then run it using ./exscript.py my_template host1 host2 host3Talking To Multiple Devices At The Same TimeWith Exscript you can automatically parallelize your connections, such that multiple sessions are opened at the same time. This can speed up the time in which a specific command is propagated within your network. For example, imagine you want to execute the clear ip bgp * soft in command on twenty different Cisco routers. Start by creating a text file with the following content: clear ip bgp * soft inSave this file as commands.exscript. Also, create a text file that contains the list of hostnames to which the command should be sent: host1host2...host20Save this file as hosts.txt. To send this change to all routers at the same time, type the following command: ./exscript.py --hosts hosts.txt -c15 commands.exscriptNote that the -c15 option causes Exscript to open a maximum of fifteen connections at the same time. Once the first host out of these 15 is completed, Exscript opens the connection to the next host, until the clear ip bgp * soft in command has been sent to all hosts. Advanced Command TemplatesExscript templates support many more commands. For example, to automate a session with a Cisco router, the following template may be used: show version {extract /^(cisco)/ as vendor}{if vendor is "cisco"} show ip interface brief {extract /^(S+)s/ as interfaces} {loop interfaces as interface} show running interface $interface configure terminal interface $interface no shut end {end} copy running-config startup-config{end}For a full overview over the template language, look at this page. Error HandlingExscript comes with excellent error handling for free, without adding any extra code into the templates. Command Line OptionsYou can pass parameters (or lists of parameters) into the templates and use them to drive what happens on the remote host. Exscript easily supports logging, authentication mechanisms such as TACACS and takes care of synchronizing the login procedure between multiple running connections. Requirements: · Python · Python-crypto · Python-pexpect · ssh


Exscript Related Software