A scripting language for automating network connections over protocols such as Telnet or SSH.. #Scripting language #Expect clone #Linux interpreter #Scripting #Language #Expect
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.
With 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:
ls
and then run it using
./exscript.py my_template host1 host2 host3
With 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 in
Save this file as commands.exscript. Also, create a text file that contains the list of hostnames to which the command should be sent:
host1 host2 ... host20
Save 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.exscript
Note 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.
Exscript 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.
Exscript comes with excellent error handling for free, without adding any extra code into the templates.
You 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.
System requirements
- Python
- Python-crypto
- Python-pexpect
- ssh
What's new in Exscript 2.1:
- The protocol API was vastly improved and handles prompt matching in a much more robust manner.
- Support for interactive connections was added.
- Exscript now includes Telnet and SSH servers.
- Exscript.util.mail has support for sending mail with attachments.
Exscript 2.1
add to watchlist add to download basket send us an update REPORT- runs on:
- Linux
- main category:
- Programming
- developer:
- visit homepage
calibre 7.9.0
Microsoft Teams 24060.3102.2733.5911 Home / 1.7.00.7956 Work
Context Menu Manager 3.3.3.1
IrfanView 4.67
Bitdefender Antivirus Free 27.0.35.146
ShareX 16.0.1
7-Zip 23.01 / 24.04 Beta
Windows Sandbox Launcher 1.0.0
Zoom Client 6.0.3.37634
4k Video Downloader 1.5.3.0080 Plus / 4.30.0.5655
- Windows Sandbox Launcher
- Zoom Client
- 4k Video Downloader
- calibre
- Microsoft Teams
- Context Menu Manager
- IrfanView
- Bitdefender Antivirus Free
- ShareX
- 7-Zip