
#!/bin/sh
# File	:  rpt_aggr-v2.sh
# By	 Maarten.deBoer@Atos.net, 120611
# Subject	: Script for reporting (from DFM) of Aggr iops into one CSV-file (v2)
PGM="`basename $0|cut -d\. -f1`"
DAY="`date +%Y-%m-%d`"
OUT="$HOME/data/${PGM}_${DAY}.out"

# Getting list:
#dfm report view -q aggregates-performance-summary 

echo -n "`date +%Y'-'%m'-'%d';'%H':'%M';'`"|tee -a ${OUT}

cat ${HOME}/etc/${PGM}.conf | grep -v \# |awk '{print $1, $2}'| while read FILER AGGR
do
  ID="`/usr/bin/dfm report view -q aggregates-performance-summary|grep ${FILER}|grep ${AGGR}|awk '{print $1}'`"
#  echo "${FILER} ${AGGR} =  ${ID}"
  DFMRPT="`/usr/bin/dfm report view -q aggregates-performance-summary ${ID}|awk '{print $3"-"$2";"$4}'`"
  echo -n "${DFMRPT} ;"|tee -a ${OUT}

done
echo " ; "|tee -a ${OUT}

exit 0

