jcmurphy777
asked on
how do i send a script to plink for a SSH connection to ESX 4
We have 3 ESX hosts, which i need to SSH into and send a script to automatically start a server.
i have created the Shell user, and can open a plink session to the host using the shell user,
i can also manually type the commands into the session and have the session perform the command, which is:
vmware-cmd -i
then listvms, or start server
now i want to do this automatically, but i havent been able to get it working.
probably cos i dont know what i am doing...lol
i created a txt file with vmware-cmd -i and listvms on 2 lines, to test but doesnt work using
plink -ssh 192.168.10.61 -l USER -pw PASS -m list.txt
any ideas or how comments on how i should do this
i have created the Shell user, and can open a plink session to the host using the shell user,
i can also manually type the commands into the session and have the session perform the command, which is:
vmware-cmd -i
then listvms, or start server
now i want to do this automatically, but i havent been able to get it working.
probably cos i dont know what i am doing...lol
i created a txt file with vmware-cmd -i and listvms on 2 lines, to test but doesnt work using
plink -ssh 192.168.10.61 -l USER -pw PASS -m list.txt
any ideas or how comments on how i should do this
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Thanks for the lesson jcmurphy77. We all learn new things everyday!
ASKER
done so many search's but to noavail,
thanks for the find.
so for everyone who might find this, in the file, you need to reference the vmware commands in directory format, according to the link za-mkh wrote above.
for example, to stop a vm, include in the command file:
/usr/bin/vmware-cmd -i /vmfs/volumes/DataStoreNam
i found a website with vmware script for the vmware-cmd
http://steveswanson.wordpress.com/category/scripting/esx-scripting/
i will test the scripting and post the full command line. will be a few weeks though. holidays...
thanks again za_mkh