File tree Expand file tree Collapse file tree
Management-Utilities/fsx-ontap-aws-cli-scripts Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -182,7 +182,7 @@ for region in ${regions[*]}; do
182182 else
183183 if [ $extraInfo == " true" ]; then
184184 if [ $( wc -l $volumeList | awk ' {print $1}' ) -gt 500 ]; then
185- echo " Sorry, too many volumes to get CloudWatch statics for."
185+ echo " Sorry, too many volumes to get CloudWatch statistics for."
186186 else
187187 volIds=$( awk -F, ' {print $3}' < $volumeList )
188188 if [ ! -z " $volIds " ]; then
220220 done
221221 echo " ]" >> $cloudwatchQueryFile
222222 aws cloudwatch get-metric-data --region $region --metric-data-queries file://$cloudwatchQueryFile --start-time=$( date -u -d ' 5 minutes ago' +" %Y-%m-%dT%H:%M:%SZ" ) --end-time=$( date -u +" %Y-%m-%dT%H:%M:%SZ" ) --output=json > $cloudwatchOutputFile
223+ if [ $? -ne 0 ]; then
224+ cat $cloudwatchOutputFile 1>&2
225+ echo " Error, failed to get CloudWatch metrics." 1>&2
226+ exit 1
227+ fi
223228 for volId in $volIds ; do
224229 volId2=$( echo $volId | sed -e ' s/-/_/g' )
225230 capacity=$( jq -r ' .MetricDataResults[] | select(.Id == "m' $volId2 ' ") | .Values[0] // 0' < $cloudwatchOutputFile )
You can’t perform that action at this time.
0 commit comments