Created
September 11, 2018 07:33
-
-
Save doi-t/4debb3f9cb1c679ef30bcf82b5c592aa to your computer and use it in GitHub Desktop.
View a stacked graph of an EC2 Per-Instance metric for EC2 instances that has prefix you specified.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# As of 2018/09/11 | |
# METEIC can be either NetworkPacketsOut, NetworkPacketsIn, DiskReadOps, StatusCheckFailed, StatusCheckFailed_Instance, NetworkOut, NetworkIn, DiskWriteBytes, StatusCheckFailed_System, CPUUtilization, DiskWriteOps or DiskReadBytes | |
METRIC='NetworkIn'; REGION='ap-northeast-1'; NAME_TAG_VALUE='your_instance_name_prefix*'; echo "https://${REGION}.console.aws.amazon.com/cloudwatch/home?region=${REGION}#metricsV2:graph=~(view~'timeSeries~stacked~false~metrics~(`aws ec2 describe-instances --filter Name=tag:Name,Values="${NAME_TAG_VALUE}" | jq '.[][].Instances[].InstanceId' --raw-output | sed "s/^/~(~'AWS*2fEC2~'${METRIC}~'InstanceId~'/g" | sed "s/$/~(stat~'Sum))/g" | tr -d '\n'`)~view~'timeSeries~stacked~true~region~'${REGION})" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment