Script to login to attached SUN Storage through Solaris m/c w/o user intervention


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Script to login to attached SUN Storage through Solaris m/c w/o user intervention
# 1  
Old 04-20-2009
Script to login to attached SUN Storage through Solaris m/c w/o user intervention

I want to create a shell script to CLI login to attached SUN 6140 storage from Sun Solaris 9 m/c (instead of using CAM )
but that prompts me for password despite the fact that i am adding them in script .. i am using "expect" feature for this .. however as i never used "expect " before .. so requesting you guys to suggest ..

Below in my example script . (may have many errors ;-) )

[12:57pm] root@dwsmum1: # cat storage_disk_check_script_old.sh
#!/usr/local/bin/expect
set PASSWD=crscp6
echo "##### Check for Storage Disk Status #####\n"
# /opt/se6x20/cli/bin/sscs login -h localhost -u root
spawn /opt/se6x20/cli/bin/sscs login -h localhost -u root
expect {
Type your password: { send "$PASSWD\r" }
}
for i in `/opt/se6x20/cli/bin/sscs list array | awk '{print $2}'` ;
do /opt/se6x20/cli/bin/sscs list -a $i disk | grep -i Failed > /dev/null;
if [ $? = 0 ] ; then echo " Disk in Storage Array $i Failed " ;
else echo " All Disks in Storage Array $i Enabled " ;
fi ;
done
exit


*******

expected result ::

it will not prompt me as "Type your password:" instead take password from script and follow the instructions and quit ..

Thanks in Advance ..
/Yogesh
Login or Register to Ask a Question

Previous Thread | Next Thread

4 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

To ask for user intervention

hi guys i want my cron to execute for every minute (5 Replies)
Discussion started by: azherkn3
5 Replies

2. Shell Programming and Scripting

How to write a shell script to automatically accept return key with out user intervention?

Hi Friends, i am creating a shell script which is accepting file name as input parameter from Java and invoking finacle service. The service will accpet text file,B2k_session id,etc and upload the text file data in finacle database. My shell script looks like this:- #! /bin/ksh... (2 Replies)
Discussion started by: vadlamudy
2 Replies

3. Solaris

How to differ local disks from attached from storage ones?

Hello. I have a solaris box with several local disks and several come from SYMMETRIX storage. Is there any way to tell format (or other util) to show only local disks? (6 Replies)
Discussion started by: urello
6 Replies

4. Shell Programming and Scripting

How to use ssh command in the shell script without user intervention?

Hello All, I need your help, i would like to know how to use ssh command in the shell scripts? and make the script continue to enter the password without user intervention example of the normal commands written manually: # ssh 172.30.1.256 -l mxread password: mxread Thanks in advance (3 Replies)
Discussion started by: Dendany83
3 Replies
Login or Register to Ask a Question