Scripts

Welcome to the Nutanix NEXT community. To get started please read our short welcome post. Thanks!

cancel
Showing results for 
Search instead for 
Did you mean: 

command "allssh genesis stop prism" not found in script

Wayfarer

command "allssh genesis stop prism" not found in script

I'm writing " restart cluster script " from this topic 

https://next.nutanix.com/t5/Scripts/Can-t-exec-command-with-CVM-commands/m-p/25712#M389

I have some problem and can't find resolve

 

command >> allssh genesis stop prism >> it's work i command line but,

not working when it on script 

 

ssh.exec_command("source /etc/profile;ncli cluster set-external-ip-address external-ip-address=x.x.x.x;allssh genesis stop prism;cluster start")

 

all command are working but only "allssh genesis stop prism" is not working

 

thank you for your help.

 

 

3 REPLIES
Nutanix Employee

Re: command "allssh genesis stop prism" not found in script

@Rinnamo allssh is a shell built-in function that is executed only in interactive shells. Since your script will be running in a non-interactive shell use the following command to execute the same action 

 

ssh nutanix@<cvmip> 'source /etc/profile; for i in $(svmips); do ssh $i "source /etc/profile; genesis stop prism"; done'


In the above command just replace the cvmip with your controller vm ip address
Wayfarer

Re: command "allssh genesis stop prism" not found in script

it's work!

 

thank you Smiley Happy

Highlighted
Nutanix Employee

Re: command "allssh genesis stop prism" not found in script

@Rinnamo Glad it worked. Please don't forget to mark the thread resolved.