cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
362
Views
0
Helpful
4
Replies
Highlighted
Beginner

SSH command ends too early

Hi,

i am executing a command python script over SSH on a remote Linux host and it is ending prematurely.

i'm issuing this:

python3 /path/to/script --vars ...

sleep 3

and i expect:

****
arguments: ....

****

response: ....

there's a few seconds of delay between the 2 sections and for some reason, the arguments get printed  in service request logs but the task finishes before the response shows up. i've tried longer sleep duration, i've tried adding constant output by the script, empty rows at the end of output... but nothing seems to keep the script from ending prematurely.

4 REPLIES 4
Highlighted
Cisco Employee

Re: SSH command ends too early

This ssh task does a new session with every line in your script. You may want in this case use a built in ssh task

Highlighted
Cisco Employee

Re: SSH command ends too early

Which ssh task are you using. There are a few built into UCSD and then I have one on the community site as well.

Highlighted
Beginner

Re: SSH command ends too early

i ended up using the enhanced SSH command which has a delay between commands which makes sure the task doesn't end before the output is printed.

Highlighted
Cisco Employee

Re: SSH command ends too early

I usually use this

https://communities.cisco.com/docs/DOC-60468

to make sure certain things are done (install of ESXi and 443 is up) and test before I have the workflow move on.

CreatePlease to create content
Content for Community-Ad

Cisco COVID-19 Survey