#!/usr/bin/ksh93 ################################################################ SSHUSER="s45x" HMCMACH="ddclphmc01" for i in $( ssh ${SSHUSER}@${HMCMACH} lssyscfg -r sys -F name ); do SYS="${i[ICNT++]//[!A-Za-z0-9]/}" ssh ${SSHUSER}@${HMCMACH} lshwres -r io --rsubtype slot -m ${i} > ${SYS}.lshwres.out done COLOR=( white red green blue yellow cyan magenta lightred lightblue lightgreen ) ICNT="0" for FNAME in Server*.lshwres.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} eval unset ${SYS}_${drc_index} eval typeset -A ${SYS}_${drc_index} IFS=";" for i in ${ATTRLINE} do 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="${SYS}_${LPAR[LCNT-1]}.html" exec 4>"${OUTFILE}" print -u 4 "\n" print -u 4 "\n
Drawer Serial | " print -u 3 "Bus | " print -u 3 "Slot | " print -u 3 "Adapter | " print -u 3 "LPAR | " print -u 3 "
---|---|---|---|---|
" eval print -u 3 "\"\${${SYS}_${IDX}[unit_phys_loc]}\"" print -u 3 " | " print -u 3 "" eval print -u 3 "\"\${${SYS}_${IDX}[bus_id]}\"" print -u 3 " | " print -u 3 "" eval print -u 3 "\"\${${SYS}_${IDX}[phys_loc]}\"" print -u 3 " | " print -u 3 "" eval print -u 3 "\"\${${SYS}_${IDX}[description]}\"" print -u 3 " | " eval OUTFILE="\"\${${SYS}_${IDX}[lpar_name]}\"" if [[ "_${OUTFILE}" != "_" ]] then OUTFILE="${SYS}_${OUTFILE}.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}[unit_phys_loc]}\"" print -u 4 " | " print -u 4 "" eval print -u 4 "\"\${${SYS}_${IDX}[bus_id]}\"" print -u 4 " | " print -u 4 "" eval print -u 4 "\"\${${SYS}_${IDX}[phys_loc]}\"" print -u 4 " | " print -u 4 "" eval print -u 4 "\"\${${SYS}_${IDX}[description]}\"" 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 "