#!/usr/bin/ksh93 ################################################################ SSHUSER="s45x" HMCMACH="ddclphmc01" for i in $( ssh ${SSHUSER}@${HMCMACH} lssyscfg -r sys -F name ); do SYS="${i//[!A-Za-z0-9]/}" print "Gathering SCSI virtual I/O info for ${SYS}" ssh ${SSHUSER}@${HMCMACH} lshwres -r virtualio --rsubtype scsi -m ${i} --level lpar >> "/tmp/tmp${$}.out" sort -n < "/tmp/tmp${$}.out" > "${SYS}.virtscsi.out" rm -f "/tmp/tmp${$}.out" done COLOR=( white red green blue yellow cyan magenta lightred lightblue lightgreen ) ICNT="0" for FNAME in Server*.virtscsi.out do unset LPAR SYSNAME[ICNT]="${FNAME%%.*}" SYS="${SYSNAME[ICNT++]//[!A-Za-z0-9]/}" sed -e "s/\".*\"//g;s/=/=\"/g;s/,,*/\";/g;s/$/\"/g" "${FNAME}" | while read -r -- ATTRLINE do eval ${ATTRLINE} drc_index="${slot_num}" eval unset ${SYS}_${drc_index} eval typeset -A ${SYS}_${drc_index} IFS=";" for i in ${ATTRLINE} do eval ${i} print "${SYS}_${drc_index}[${i%%=*}]=${i##*=}" eval eval ${SYS}_${drc_index}[\${i%%=*}]="\"\${i##*=}\"" done eval ${SYS}_index[SCNT++]="\"\${drc_index}\"" eval LPAR[LCNT++]="\"\${${SYS}_${drc_index}[lpar_name]}\"" if [[ "_${LPAR[LCNT-1]}" != "_" ]] then OUTFILE="${LPAR[LCNT-1]}.virtualscsi.html" exec 4>"${OUTFILE}" print -u 4 "\n" print -u 4 "\n
Adapter Type | " print -u 3 "Slot | " print -u 3 "Remote LPAR | " print -u 3 "Remote Slot | " print -u 3 "Backing Device | " print -u 3 "LPAR Name | " print -u 3 "|
---|---|---|---|---|---|---|
" # eval print -u 3 "\"\${${SYS}_${IDX}[lpar_name]}\"" # print -u 3 " | " print -u 3 "" eval print -u 3 "\"\${${SYS}_${IDX}[adapter_type]}\"" print -u 3 " | " print -u 3 "" eval print -u 3 "\"\${${SYS}_${IDX}[slot_num]}\"" print -u 3 " | " print -u 3 "" eval print -u 3 "\"\${${SYS}_${IDX}[remote_lpar_name]}\"" print -u 3 " | " print -u 3 "" eval print -u 3 "\"\${${SYS}_${IDX}[remote_slot_num]}\"" print -u 3 " | " print -u 3 "" eval print -u 3 "\"\${${SYS}_${IDX}[backing_devices]}\"" print -u 3 " | " eval OUTFILE="\"\${${SYS}_${IDX}[lpar_name]}\"" if [[ "_${OUTFILE}" != "_" ]] then OUTFILE="${OUTFILE}.virtualscsi.html" print -u 3 "" print -u 3 " " eval print -u 3 "\"\${${SYS}_${IDX}[lpar_name]}\"" print -u 3 " " print -u 3 " | " exec 4>>"${OUTFILE}" print -u 4 "
" eval print -u 4 "\"\${${SYS}_${IDX}[adapter_type]}\"" print -u 4 " | " print -u 4 "" eval print -u 4 "\"\${${SYS}_${IDX}[slot_num]}\"" print -u 4 " | " print -u 4 "" eval print -u 4 "\"\${${SYS}_${IDX}[remote_lpar_name]}\"" print -u 4 " | " print -u 4 "" eval print -u 4 "\"\${${SYS}_${IDX}[remote_slot_num]}\"" print -u 4 " | " print -u 4 "" eval print -u 4 "\"\${${SYS}_${IDX}[backing_devices]}\"" print -u 4 " | " print -u 4 "" eval print -u 4 "\"\${${SYS}_${IDX}[lpar_name]}\"" print -u 4 " | " print -u 4 "" print -u 3 " " print -u 3 " | " fi print -u 3 " " print -u 3 "" done print -u 3 "