Questions tagged [exscript]

Python module and cli tool with templates to automate exchanges with remote machines.

Exscript is a Python 2.7 module that facilitates writing automatic conversations with remote machines, typically over ssh or telnet. Several router manufacturer protocols are recognised. A templating language allows extraction of wanted information from the interaction.

Command line tools can simplify parallel connections to many hosts, and generate email reports.

Exscript is published under the MIT licence.

11 questions
6
votes
1 answer

Exscript: How do I switch between interactive and non interactive sessions?

I am trying to programaticaly open a session with a Unix server and then release the control to the user of the script till Ctrl+y is pressed after which the program should take control I am using Eclipse and WinPython 2.7. here is the code from…
MiniMe
  • 1,057
  • 4
  • 22
  • 47
2
votes
0 answers

Exscript: Telnet response includes prompt's first character?

I need to use "telnet" to connect to my camera. I had used putty and knew that the camera prompt was '~ # '. If I execute 'echo "test"' then I expect the response 'echo "test"\r\ntest\r\n'. But Exscript's response is 'echo "test"\r\ntest\r\n~',…
1
vote
1 answer

Python Exscript - use 8022 instead of 22 port with ssh

Is there a possibility of connecting with ssh to a different port other than the standard port 22 in Python Exscript module? If so, how can this be achieved? Couldn't find anything relevant when browsing the documentation.
1
vote
1 answer

Exscript: Access to remote network devices via a bastion host while still using device specific drivers to recognize the device prompt

I am trying to access network devices that are accessible only if you ssh from a bastion host that runs SunOS (no proxycommand support or ssh tunneling) My approach would be to use the generic driver to access the bastion host. and from there to use…
MiniMe
  • 1,057
  • 4
  • 22
  • 47
1
vote
1 answer

Using Python Exscript need to create regular expression for set_prompt() for cisco switch

Having a hard time figuring out how to write a regular expression in python/exscript so that the prompt matches the output when i run "copy run tftp"... For example the prompt changes to... "Address or name of remote host []?" then…
Yawnoc
  • 11
  • 2
1
vote
0 answers

python exscript - ssh to device having issues with login buffer is empty

I'm just building my first login to a device script, and am having some issues, im getting the below error, all i have changed is the port no, but the issue seems to be with login, i have entered the correct user pass thats for…
AlexW
  • 2,843
  • 12
  • 74
  • 156
1
vote
3 answers

Python Exscript - JunOS

I'm trying to to run a script to show all of the configuration and write them on files for juniper and CISCO routers. So far the CISCO script is working as it should but the thing is with the juniper router. for ii in JUNIPER: print ii …
D Go
  • 13
  • 4
0
votes
0 answers

Exscript does not return full output

I have a simple script (below) which should return an output from a simple show command but instead I am getting the one line of the output or no output at all. >>> from Exscript.protocols import * >>> conn = SSH2() >>>…
gh0st
  • 402
  • 5
  • 13
0
votes
1 answer

How do I install Exscript for Python 3.5 under Windows x86

Can anybody help with instructions to install this for Python 3.5 x32 running on Windows? I think that the usual way (pip install exscript) attempts to install the wrong version Here is the error that I am getting Collecting exscript Using cached…
MiniMe
  • 1,057
  • 4
  • 22
  • 47
0
votes
0 answers

Regular expression used in Exscript prompt - understanding existing one or creating a custom one

I am having trouble with understanding this regular expression that exscript is using to detect the prompt for an NX-OS switch '[\\\\r\\\\n][\\\\-\\\\w+\\\\.:/]+(?:\\\\([^\\\\)]+\\\\))?[>#] ?$' This is Python My prompt should be something like a…
MiniMe
  • 1,057
  • 4
  • 22
  • 47
-1
votes
1 answer

Cannot import Exscript into Python

I'm using windows 10, and I have a script to SSH to the device and do some configurations: from Exscript import Account from Exscript.protocols import SSH2 account = Account("user","password") conn = SSH2() …
Mahdi
  • 967
  • 4
  • 18
  • 34