AWS/CloudWatch awscloudwatchmemoryusedcustommetricdata 12/02/2017

Put memory used as custom CloudWatch metric data

Examples:

memused=`free | awk 'NR==2{printf "%s", $3}'`
instanceid=`wget -q -O - http://169.254.169.254/latest/meta-data/instance-id`
timez=`date --utc +%FT%TZ`
aws cloudwatch put-metric-data --metric-name MemoryConsumption --namespace Custom --timestamp "$timez" --value "$memused" --unit Bytes --dimensions "InstanceId=$instanceid"