Setting up HP SIM 5.x on an HP-UX Serviceguard Cluster (448492-002, February 2008)

25
#Note: This is an abnormal condition and cannot be determined
# why this condition exists. A person had to have added
# multiple tags for some reason
and as a result Serviceguard
# cannot assume why and thus cannot bring the package up
# or remove the tags automatically. That has to be done by
# a real person.
if [[ "$hostid" = *,* ]]; then
printf "ERROR: Volume Gr
oup $vg has multiple tags
\
"($hostid)
\
"
defined.
\
n"
printf " There cannot be more than one tag.
\
n"
printf " Remove the tags using the command(s):
\
n"
OLDIFS=$IFS
IFS=","
for i in ${hostid}; do
printf "
\
"vgchange
--
deltag $i $vg
\
".
\
n"
done
IFS=$OLDIFS
return 1
fi
#get the hostname of the node
host=$(uname
-
n)
if (( $? != 0 )) ; then
printf "activation_check: Error in getting the hostname
\
n"
return 1
fi
#check hostid
if [[ "$hostid" != "" ]] ; then
status=""
if [[ $host != $hostid ]] ; then
cl_hostid=${hostid%%.*}
#get status of node
status=$(cmviewcl
-
f line
-
n $c
l_hostid | grep state)
if (( $? != 0 )) ; then
#try again
status=$(cmviewcl
-
f line
-
n $cl_hostid | grep state)
if (( $? != 0 )) ; then
#give up
printf "activation_c
heck: Error in cmviewcl.
\
n"
printf "cmviewcl output:
\
n"
cmviewcl
-
n $cl_hostid
return 1
fi
fi
status=${status#*=}
case $status in
*ailed*
)
printf "activation_check:
\
n$hostid status failed..okay to
activate $vg
\
n"
# remove the old tag since that host is failed.
vg_tag deltag $vg $hostid
ok_to_activate=1
;;
*)
printf "activation_check:
\
n"
printf "Error $vg may still be activated on $hostid
\
n"
printf "To correct this situation, logon to
\
"$hostid
\
" and
\
n"
printf "execut
e the following commands:
\
n"
printf " vgchange
-
a n $vg
\
n"
printf " vgchange
--
deltag $hostid $vg
\
n
\
n"
printf "Once
\
"$vg
\
" has been deactivated from
\
"$hostid
\
",
\
n"
printf "this package m
ay be restarted via either cmmodpkg(1M)
\
n"
printf "or cmrunpkg(1M).
\
n
\
n"