#!/usr/bin/ksh # # Author Tim Fulford # Date 24 Feb 2003 # Purpose Process the MeasureWare data into single, meaningful .txt files # # This file is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # # Tim Fulford may not respond to external queries # regarding the distribution or content of this file. # # Global stuff if [ -f xfrdGLOBAL.asc ] then echo "doing GLOBAL..." cp xfrdGLOBAL.asc global.txt fi if [ -f xfrsGLOBAL.asc ] then echo "doing summary GLOBAL..." cp xfrsGLOBAL.asc sglobal.txt fi # Application stuff if [ -f xfrdAPPLICATION.asc ] then echo "doing APPLICATION..." for app in $(awk -F"|" 'NR>3{print $3}' xfrdAPPLICATION.asc | sort -u) do awk -F"|" 'NR<4 || $3~ APP {print $0}' APP="^$app\ " xfrdAPPLICATION.asc > $app.txt done fi if [ -f xfrsAPPLICATION.asc ] then echo "doing summary APPLICATION..." for app in $(awk -F"|" 'NR>3{print $3}' xfrsAPPLICATION.asc | sort -u) do awk -F"|" 'NR<4 || $3~ APP {print $0}' APP="^$app\ " xfrsAPPLICATION.asc > s$app.txt done fi # Network stuff if [ -f xfrdNETIF.asc ] then echo "doing NETIF..." for lan in $(awk -F"|" 'NR>3{print $3}' xfrdNETIF.asc | sort -u) do awk -F"|" 'NR<4 || $3~ LAN {print $0}' LAN="^$lan\ " xfrdNETIF.asc > $lan.txt done fi if [ -f xfrsNETIF.asc ] then echo "doing summary NETIF..." for lan in $(awk -F"|" 'NR>3{print $3}' xfrsNETIF.asc | sort -u) do awk -F"|" 'NR<4 || $3~ LAN {print $0}' LAN="^$lan\ " xfrsNETIF.asc > s$lan.txt done fi # Disk stuff if [ -f xfrdDISK.asc ] then echo "doing DISK..." i=0 for dsk in $(awk -F"|" 'NR>3{print $3}' xfrdDISK.asc | sort -u) do i=$(expr $i + 1) egrep "MWA|Dev|Nam|$dsk" xfrdDISK.asc > dsk$i.txt done fi if [ -f xfrsDISK.asc ] then echo "doing summary DISK..." i=0 for dsk in $(awk -F"|" 'NR>3{print $3}' xfrsDISK.asc | sort -u) do i=$(expr $i + 1) egrep "MWA|Dev|Nam|$dsk" xfrsDISK.asc > sdsk$i.txt done fi # Configuration stuff if [ -f xfrdCONFIGURATION.asc ] then echo "doing CONFIGURATION..." awk 'NR<=3{print $0}; {line=$0}; END {print line}' xfrdCONFIGURATION.asc > config.txt fi if [ -f xfrsCONFIGURATION.asc ] then echo "doing summary CONFIGURATION..." awk 'NR<=3{print $0}; {line=$0}; END {print line}' xfrsCONFIGURATION.asc > sconfig.txt fi # By CPU stuff if [ -f xfrdCPU.asc ] then echo "doing CPU..." for cpu in $(awk -F"|" 'NR>3{print $3}' xfrdCPU.asc | sort -u) do awk -F"|" 'NR<=3{print $0}; NR>3 && $3==CPU {print $0}' CPU=$cpu xfrdCPU.asc > cpu${cpu}.txt done fi if [ -f xfrsCPU.asc ] then echo "doing summary CPU..." for cpu in $(awk -F"|" 'NR>3{print $3}' xfrsCPU.asc | sort -u) do awk -F"|" 'NR<=3{print $0}; NR>3 && $3==CPU {print $0}' CPU=$cpu xfrsCPU.asc > scpu${cpu}.txt done fi # By LVOL stuff if [ -f xfrdLVOLUME.asc ] then echo "doing LVOLS..." for lv in $(awk -F"|" 'NR>3{print $3}' xfrdLVOLUME.asc | sort -u) do vgn=$(echo $lv | awk -F"/" '{print $3}') lvn=$(echo $lv | awk -F"/" '{print $4}') egrep "MWA|Read|Dat|${lv}\ " xfrdLVOLUME.asc > ${vgn}-${lvn}.txt done fi if [ -f xfrsLVOLUME.asc ] then echo "doing LVOLS..." i=0 for lv in $(awk -F"|" 'NR>3{print $3}' xfrsLVOLUME.asc | sort -u) do vgn=$(echo $lv | awk -F"/" '{print $3}') lvn=$(echo $lv | awk -F"/" '{print $4}') egrep "MWA|Read|Dat|${lv}\ " xfrdLVOLUME.asc > s${vgn}-${lvn}.txt done fi