#!/bin/ksh
# auditLPAR_RemoteRestart.sh
# Ch.SONOLET
DATEUS="`date +%m/%d/%y`"
export USERNAME=`whoami`
[ $DIR_MANAPP ] || DIR_MANAPP=/nim/script/manapp
export DIR_MANAPP
export DIR_FILES=/tmp/resu/frames
if test ! -d $$DIR_FILES
then
mkdir -p $DIR_FILES
fi
if test $# -lt 1
then
echo "Usage $0 hmc_name system_name"
exit 4
fi
HMC_NAME=$1
FRAME=$2
if test "$FRAME" = ""
then
FRAME=""
for nom in `$DIR_MANAPP/tools/auditFramesNames.sh $HMC_NAME`
do
FRAME="$FRAME $nom"
done
fi
echo "Traitement de $FRAME"
#echo "name,lpar_name,lpar_id,min_mem,desired_mem,max_mem,mem_mode,min_proc_units,desired_proc_units,max_proc_units,min_procs,desired_procs,max_procs,sharing_mode,uncap_weight"
echo "LparName,name,restart_capable,status,sync_profile" |awk -F"," '{ printf("%-25s %-30s %-10s %10s %10s\n",$1,$2,$3,$4,$5) }'
for system in $FRAME
do
ssh -n $HMC_NAME -l $USERNAME "lssyscfg -m $system -r lpar -F name,simplified_remote_restart_capable,remote_restart_status,sync_curr_profile" |sed "s/^/$system,/" |awk -F"," '{ printf("%-25s %-30s %-10s %10s %10s\n",$1,$2,$3,$4,$5) }'
done