cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
935
Views
0
Helpful
4
Replies

SSH command ends too early

Mazimer
Level 1
Level 1

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

Orf Gelbrich
Cisco Employee
Cisco Employee

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

Orf Gelbrich
Cisco Employee
Cisco Employee

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

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.

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.

Cisco UCS X-Series Energy Efficiency Offer