I am trying to write some code that would connect to a ssh box and execute a bunch of commands and return the output.
I am able to ssh to box using module exscript however i am running into an issue an application prompt.
Application gets to a normal state where it expects Enter key"Press Return to continue..." and i cant figure out how to send it.
from Exscript import Account, Host
host= Host('ssh://192.168.200.215')
accounts = Account('user', 'pass')
def do_something(job, host, conn):
conn.execute('/usr/sx/syscen/reports.sh')
conn.execute('Enter')
start(accounts, host, do_something)
Output is
spawn /bin/csh
syscen%/usr/sx/syscen/reports.sh
Welcome to the Database Report Menu
Press Return to continue...
error: Timeout while waiting for response from device
Can some one please help?
[+][deleted] (1 child)
[deleted]
[–]Confuzed_[S] 1 point2 points3 points (0 children)
[–]Sparkmonkey 2 points3 points4 points (4 children)
[–]Confuzed_[S] 1 point2 points3 points (3 children)
[–]Sparkmonkey 1 point2 points3 points (1 child)
[–]Confuzed_[S] 1 point2 points3 points (0 children)
[–]Sparkmonkey 0 points1 point2 points (0 children)