I have one host i need to run in loop to check the capacity from different frame and get the output to one file and sum it and convert to TB
this is Code
#!/bin/ksh
DATE=`date '+%d%m%y'`
for f in `cat /home/esx-capacity/esx-host.txt`
do
for g in `cat /home/esx-capacity/frame`
do
symaccess -sid $g list devinfo -ig $f |grep -i total |awk '{print $3} > /home/esx-capacity/num
done
done
echo $g - num >> Report
esx-host.txt -test1server
frame -123,234,345
I need to get the capacity from each frame and sum all and provide the output as below
test1server - 1000 TB
#!/bin/ksh
DATE=`date '+%d%m%y'`
while read f
do
tr ',' '\n' < /home/esx-capacity/frame | while read g
do
symaccess -sid $g list devinfo -ig $f
done | grep -i total | awk '{t+=$3} END {print f " - " t}' f=$f
done < /home/esx-capacity/esx-host.txt > /home/esx-capacity/Report
#!/bin/ksh
DATE=`date '+%d%m%y'`
while read f
do
tr ',' '\n' < /home/esx-capacity/frame | while read g
do
symaccess -sid $g list devinfo -ig $f
done | grep -i total
done < /home/esx-capacity/esx-host.txt
#!/bin/ksh
DATE=`date '+%d%m%y'`
while read f
do
tr ',' '\n' < /home/esx-capacity/frame | while read g
do
echo "$g:::$f"
#symaccess -sid $g list devinfo -ig $f
done
done < /home/esx-capacity/esx-host.txt
awk '{a[$2]+=$NF} ; END {for (i in a) print i " = " a}' Report
---------- Post updated at 12:04 PM ---------- Previous update was at 11:59 AM ----------
Still it is blank only. FYI i am running this from my CYGWIN console
#!/bin/ksh
DATE=`date '+%d%m%y'`
while read f
do
tr ',' '\n' < /home/esx-capacity/frame | while read g
do
echo "$g:::$f"
symaccess -sid $g list devinfo -ig $f
done |awk '{a[$2]+=$NF} ; END {for (i in a) print i " = " a}'
done < /home/esx-capacity/esx-host.txt > /home/esx-capacity/Report
#!/bin/ksh
DATE=`date '+%d%m%y'`
while read f
do
tr ',' '\n' < /home/esx-capacity/frame | while read g
do
#symaccess -sid $g list devinfo -ig $f
echo symaccess -sid $g list devinfo -ig $f
done
done < /home/esx-capacity/esx-host.txt