Storage Software
cancel
Showing results for 
Search instead for 
Did you mean: 

run sssu comands on linux system.

SOLVED
Go to solution
klemerS
Frequent Advisor

run sssu comands on linux system.

Hello.

I am trying to run sssu script on linux with
no success.

if i run: /usr/sbin/sssu "file /tmp/sssusanp.txt"
the sssu run with no problem at all, but if i
put this command into simple shell script & run the script it's fail :

the script do the sssu command , give me the prompt of unselectedsystem> file
& then fail with something wrong with syntax.

Create-snap script:

/usr/sbin/sssu "file /tmp/sssusnap.txt"
/opt/hp/hp_fibreutils/hp_rescan -a
mount -t ext3 /dev/sde1 /snap_vd1_db1
mount -t ext3 /dev/sdf1 /snap_vd2_db2
mount -t ext3 /dev/sdg1 /snap_vd3_db3
exit

sssusnap.txt:

set options on_error=halt_on_error
set options command_delay=10
select manager 10.0.4.40 username=administrator password=administrator
select cell "OUR_EVA"
ADD SNAPSHOT SNAP_VD_1 STORAGE="\Virtual Disks\WISE-RAC\VD-WISE-RAC-1\ACTIVE" ALLOCATION_POLICY=DEMAND
ADD SNAPSHOT SNAP_VD_2 STORAGE="\Virtual Disks\WISE-RAC\VD-WISE-RAC-2\ACTIVE" ALLOCATION_POLICY=DEMAND
ADD SNAPSHOT SNAP_VD_3 STORAGE="\Virtual Disks\WISE-RAC\VD-WISE-RAC-3\ACTIVE" ALLOCATION_POLICY=DEMAND
ADD LUN 5 STORAGE="\Virtual Disks\WISE-RAC\VD-WISE-RAC-1\SNAP_VD_1" HOST="\Hosts\WiseDEVDB1"
ADD LUN 6 STORAGE="\Virtual Disks\WISE-RAC\VD-WISE-RAC-2\SNAP_VD_2" HOST="\Hosts\WiseDEVDB1"
ADD LUN 7 STORAGE="\Virtual Disks\WISE-RAC\VD-WISE-RAC-3\SNAP_VD_3" HOST="\Hosts\WiseDEVDB1"
EXIT


Any Hints how should i run the script ??


Thanks.

Shalom.

 

 

P.S. This thread has been moved from Storage Area Networks (SAN) (Enterprise) to HP Storage System Scripting Utility (SSSU). - Hp Forum MOderator

5 REPLIES
Thorsten Herd
Occasional Advisor

Re: run sssu comands on linux system.

Hi I think you are just missing the redirect and full path


/opt/..../sssu < /../../scriptfile


we use this on linux and solaris, with similar syntax in the sssu script file

klemerS
Frequent Advisor

Re: run sssu comands on linux system.

Hi.

So you mean that I should put in redirect of the script file:

/usr/sbin/sssu < /tmp/sssusnap.txt

& not as i tried from the sssu docs -

/usr/sbin/sssu "file /tmp/sssusnap.txt"

Regards.

Shalom.
Thorsten Herd
Occasional Advisor

Re: run sssu comands on linux system.

Corect, I have not seen the documentation that you are talking about, but a redirect < gives the script file to execute and if you follow up with a redirect > to a file you can also capture the output.

If the last command in the script is not exit it will display an error with unexpected end of file or something along those lines.
Cem Tugrul
Esteemed Contributor
Solution

Re: run sssu comands on linux system.

Hi Klemer,

here are some pieces of my script from beginnig about my snap.sh;
Hope this helps,

#!/usr/bin/ksh
#set -xv

#2) Yanlis device'in vgimport edilmesi. : N-class'in 3 snap haricindeki disklere ulasimina izin verilmemesi gerekir.
# WWID kontrolu 11i ile konacak

typeset -i line_count
typeset -i ExitStatus

export LOGFILE="/HP/LOG/SNAPCLONE.log"
export DETAIL_LOGFILE="/HP/LOG/SNAPCLONE.detail.log"
echo "===================================`date`==========================">>$DETAIL_LOGFILE

export PATH=$PATH:/usr/bin:/usr/sbin:/sbin:/opt/sssu
#export SSSU_EXECUTABLE="/opt/sssu/sssu"
export SSSU_EXECUTABLE="/sbin/sssu"

if [ ! -x $SSSU_EXECUTABLE ]; then
EchoWithDate "sssu executable'i bulunamadi"
exit 1
fi

EchoWithDate ()
{
cat <>$LOGFILE
`date +"%d/%m/%y %H:%M:%S>"` $1
ECHOWITHDATE
}

#Eger hata olusursa, hata verilip cikilir
AddSnapclone_1 () {
TEMP_FILE=`mktemp`
EchoWithDate "Adding Snapclone baandat_baan02 in \Virtual Disks\BAAN01\baandat\ACTIVE as LUN 40"
EchoWithDate "Adding Snapclone archivedat_baan02 in \Virtual Disks\BAAN01\archivedat\ACTIVE as LUN 41"

$SSSU_EXECUTABLE >$TEMP_FILE 2>&1 <<- EOF
select manager EVAmanagement username=administrator password=administrator
select cell EVA01
set options on_error=exit_on_error
.
.
.
.

Good Luck,
Our greatest duty in this life is to help others. And please, if you can't
klemerS
Frequent Advisor

Re: run sssu comands on linux system.

Thank you !!!!

I will try using the most of it.

Great.