Skip to content

Commit dab420e

Browse files
committed
Fixed a typo
1 parent 4992d33 commit dab420e

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

Management-Utilities/fsx-ontap-aws-cli-scripts/list_fsxn_volumes

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff 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
@@ -220,6 +220,11 @@ EOF
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)

0 commit comments

Comments
 (0)