I am new to this concept so please help!
I am using Paramiko Channel to execute a command and start a trace. I want the trace to continue running until I send a stop request to trace. If I use channel.send(cmd) it starts and stops the trace whereas I want that the trace should be continue and only stop when I send any stop request as I have other actions to perform before stopping the trace.
Note: I am doing SSH in one machine with Paramiko and starting a new channel in that machine to ssh into one more machine to start the trace there. I tried exec_command but it closes the socket.
Thing I want to know:
- How can I start the trace and not let the command stop it before returning
- How to stop the trace after I perform my actions after starting the trace.
The code I am using:
chan = sshClient.get_transport().open_session()
chan.get_pty()
chan.invoke_shell()
chan.send(cmdline +'\n')
while not sshClient.recv_ready():
print("Waiting")
resp = chan.recv(9999)
print(resp)
Thanks for your help in advance!