Monday, February 1, 2016

Printing EMC ReceverPoint Journal Lag with ksh Script

 rpa_stats_simple.ksh

#!/bin/ksh
RPAUSER=username
RPAIP=10.11.12.13
#RPAPREFIX is the standart prefix generally used before consistency group name
RPAPREFIX=CG_

total_lag_gb=0
echo "\n"|ssh $RPAUSER@$RPAIP get_group_statistics|egrep "$RPAPREFIX.*|Journal lag"|sed '/CG_.*:/N;s/\n/ /'|grep "GB$"|sort -k4n|
while read cg j l lag
do
  print $cg "\t\t" $lag
  lag_gb="`echo $lag|sed -e 's/GB//'`"
  total_lag_gb=`echo "scale=2\n$total_lag_gb+$lag_gb"|bc`
done
print "Total Copy Journal Lag: " $total_lag_gb
if [[ $total_lag_gb -gt 2900 ]]; then
  print "Total copy cournal lag is more than 2900 GBs"
fi
date

No comments: